• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

I wanted to select last used cell from the selected range with the help of a macro

Shailender

Member
Here is the question, I have attached two sheets Sheet1 & Sheet2 . I want to select the last used cell from the selected range, here my range is yellow color one.

In this case I have colored the cell in red color that is the result I want. This cell may vary I mean it suppose to be in any other column (C,D,E,F,g,h)

Once that is selected I want to select the range from (A1 to last used cell from the selected range). For you reference I've attached two sheets.

Hope the question is clear. Thank you in advance.
 

Attachments

  • Question.xlsx
    11.6 KB · Views: 4
Hey Alansidman, thank you for your help. But still i am unable to get what i want. Could you please check in detail?
 
Hey Vletm, thank you for the code. But i am unable to run the code. When i run the macro through F8 & F5 command key it is not functioning. Any help will be appreciated.
 
Vletm, thank you for the quick reply.

Yes i do agree we shall do by selecting the range by mouse. But i have a task where i shall open 40 files and need to copy data from all the sheets(like i've given in the excel sheet) and the same should paste into master sheet, so for this i'm trying write a macro to run the task automatically...hope this is clear?
 
Shailender
... hmm ... as I wrote in #5 Reply ... please, reread it.
Your #8 Reply case ... is different than Your original case.
...
If You write this
and
You think that
You'll get this
not that!

Hint: You should write 'what You want'.

Of course, You could get codes in small steps ...
but then those codes would try to combine ...
there will be a lot of code
which could write 'much better'.
= a lot of extra hours.

What would be 'the whole Your needs'?
 
Vletm, thank you for quick response. I am little confused on your replies.To make it simple i want to find out last used cell in the selected range with the help of macro? would it be possible? if possible how?
 
Shailender
Many things would be possible,
but if eg no answers ...
it'll be a challenge
Test this:
1) have own folder for next file
2) copy next file to previous folder
3) copy at least 'Question (1).xlsb'-file to previous folder
4) press [ Do It ]-button
 

Attachments

  • ThisOrThat.xlsb
    20.5 KB · Views: 1
Back
Top