LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default VBA store location as variable

Is there a way to store a range as a variable so that later I can go back to
that location? If so, what do you DIM the variable as?

For example, this is what I have so far:
DIM row1 as Long

Cells.Find(What:=Month_Year, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

Selection.End(xlDown).Select
row1 = Cells(ActiveCell.Row + 1, ActiveCell.Column)
(at this point I have statements that insert values into cells near this
location, so I can't redo the same find)

And then later I try to go back to that spot:
Sheets("pivot table").Range(row1).Activate

 
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
worksheet name store in a variable Steve P[_2_] Excel Programming 3 February 14th 07 05:54 AM
Way to store cell location to variable? farful[_3_] Excel Programming 2 July 12th 06 11:44 PM
store variable keen learner Excel Programming 9 March 8th 06 02:26 PM
How to store current row into variable ilyaskazi[_81_] Excel Programming 1 October 12th 05 05:03 AM
Store variable value for Chart Al Jager Excel Programming 1 February 19th 04 10:58 AM


All times are GMT +1. The time now is 01:40 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"