Returning to activecell

  • Thread starter Thread starter TJ
  • Start date Start date
T

TJ

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...
 
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..
 
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)
 
Back
Top