Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tj tj is offline
external usenet poster
 
Posts: 6
Default 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...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default 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..

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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...



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Activecell problem [email protected] Excel Discussion (Misc queries) 1 October 26th 05 02:13 PM
Defining an Activecell Ant Excel Discussion (Misc queries) 6 October 3rd 05 05:32 PM
how to set activecell? ljb[_2_] Excel Programming 2 November 18th 03 04:49 PM
ActiveCell.FormulaR1C1 Leif Rasmussen Excel Programming 1 October 16th 03 09:46 AM


All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"