ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Returning to activecell (https://www.excelbanter.com/excel-programming/294985-returning-activecell.html)

tj

Returning to activecell
 
I use this code to insert 4 blank lines.

vUnit = ActiveCell
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(4, 0))._
EntireRow.Select
Selection.Insert Shift:=xlDown

How do I get the cursor to go back to the activecell? I
can't hard code the cell reference because it will change
throughout the macro. I also tried:"Range(ActiveCell).
_Select" but that did not work.

Thanks for the help...

Chris

Returning to activecell
 
dim c as rang

vUnit = ActiveCel
set c = selectio
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(4, 0))._
EntireRow.Selec
Selection.Insert Shift:=xlDow
c.selec

----- TJ wrote: ----

I use this code to insert 4 blank lines

vUnit = ActiveCel
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(4, 0))._
EntireRow.Selec
Selection.Insert Shift:=xlDow

How do I get the cursor to go back to the activecell? I
can't hard code the cell reference because it will change
throughout the macro. I also tried:"Range(ActiveCell).
_Select" but that did not work.

Thanks for the help..


Bob Phillips[_6_]

Returning to activecell
 
If you don;t select it, you don't need to go back, it stays there

Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(4, 0)). _
EntireRow.Insert Shift:=xlDown

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"TJ" wrote in message
...
I use this code to insert 4 blank lines.

vUnit = ActiveCell
Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(4, 0))._
EntireRow.Select
Selection.Insert Shift:=xlDown

How do I get the cursor to go back to the activecell? I
can't hard code the cell reference because it will change
throughout the macro. I also tried:"Range(ActiveCell).
_Select" but that did not work.

Thanks for the help...





All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com