Hello,
I'm looking for a code to say:
- Select 50th cell from the top of the sheet, basing it from the ActiveCell
Example
Active Cell is: C79
Select: C50
Hello,
I'm looking for a code to say:
- Select 50th cell from the top of the sheet, basing it from the ActiveCell
Example
Active Cell is: C79
Select: C50
Last edited by clprdctn; 08-08-2016 at 11:44 AM.
Cells(50, ActiveCell.Column).Select
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
Thank you Alpha - How can I make it applicable to a merged cell? I didn't realize that was going to be an issue.
In the example above, the "title" i'm trying to select can be on B50 or A50. Is there any way?
Active Cell is: C79
Select: C50
...just a comment on good practice.
Try to avoid selecting or activating stuff. Rarely is this necessary although I accept this may be an exception if you do want to position the cursor on C50 and look at it rather than do something with it.
Just refer directly to the object in question. Selecting stuff has a time overhead and with larger systems and macros can really slow things down considerably.
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Maybe I'm plugging it wrong then - because I'm doing exactly that:
If C79 is the active cell, it selects C50. C50 is part of merged cells, however it does not select the entire merged cell.
If it helps here's the full wording in that row of that VBA:
Please Login or Register to view this content.
...This is somewhat confusing. Your original question concerned navigating to a particular cell. You now seem to be flagging up something else to do with Outlook.
Apart from selecting C50 (presumably with some other macro since there's no selecting taking place in this latest code) )which is merged and hence the whole of the merged range is outlined although C50 is regarded as the 'Active' cell, what are you attempting to do?
Your example code doesn't "Select" any cell. If you want to get the value of the merged cells, try something like this...
Cells(50, ActiveCell.Column).MergeArea(1).Value
It works - thank you AlphaFrog!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks