select the next row down at the end of my macro. I tried to do this recording a macro using the down arrow and it did not work.
Any help is greatly appreciated.
select the next row down at the end of my macro. I tried to do this recording a macro using the down arrow and it did not work.
Any help is greatly appreciated.
How do I...
Henrik Dahl
You need to provide more information ie how is your macro moving from cell to cell.
At the end of your macro, where is the active cell etc.
Selection.Offset(1,0).select could be one method but need to know more
ChasAA
DoS
Hello Sleeks,
The selection.offset(1,0) needs to to have a bigger offset (ie the number of rows that are selected already)
use the following lines:
nbrRows = Selection.Rows.Count ' store the number of selected rows
ActiveCell.Select ' select the first cell of the range
Selection.Offset(nbrRows, 0).Select ' come down by that many rows
Cheers
Chas
Prashant_Rai
I am copying a range of cells within a column and pasting them into a new worksheet as a row using Paste Special, Transpose
I highlight the range (can't do this in the macro since it varies), and then run the macro which copies the selection and then switches worksheets and does the paste special transpose. Once the macro runs, I would like it to move down one cell so that the next time I run the macro, I don't have to manually move the selected cell down one row.
I put the Selection.offset(1,0).select into the last line of my macro and it is closer to what I need except it selects the same range that I just pasted one row down.
Let me know if this isn't enough info.
Thanks
GSharad1234
Just had a look at your post again.
You don't really need the first line that gets the number of rows selected.
You can omit that line and change the last line to selection.offset(1,0).select. (perhaps leave it as it is if there is ever a chance that two or more rows will be selected).
Chas
salafa
Thanks, I added the activecell.select and it works fine now. This will save me a LOT of time.