Returning to activecell


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...
 
Ad

Advertisements

G

Guest

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..
 
Ad

Advertisements

B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top