Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
OS: MS Xp
Excel 2003 I am in say cell E127 and need t go to cell B2. I then need to return to cell E127. Problem is E127 is different each time. How do I read the cell address in VBA so that I may return to it? Thanks in advanced. -- Richard |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Declare a range object variable:
Dim StartCell as Range When you need to remember the current active cell's address: Set StartCell = ActiveCell When you want to return to that cell later: StartCell.Activate At the end of your macro, add: Set StartCell = Nothing Hope this helps, Hutch "Richard" wrote: OS: MS Xp Excel 2003 I am in say cell E127 and need t go to cell B2. I then need to return to cell E127. Problem is E127 is different each time. How do I read the cell address in VBA so that I may return to it? Thanks in advanced. -- Richard |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() something like this... Dim rngFirstCell as Range, rngSecondCell as Range Set rngFirstCell = ActiveCell 'Assuming E127 is the active cell here Set rngSecondCell = Cells(2,2) 'i.e. B2 '--- 'Code that does something to rngSecondCell '--- rngFirstCell.Activate 'Go back to e127 On Apr 15, 1:16 pm, Richard wrote: OS: MS Xp Excel 2003 I am in say cell E127 and need t go to cell B2. I then need to return to cell E127. Problem is E127 is different each time. How do I read the cell address in VBA so that I may return to it? Thanks in advanced. -- Richard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
reading a blank cell as zero | Excel Discussion (Misc queries) | |||
Reading the Latest Value into a cell | Excel Worksheet Functions | |||
Reading a cell in VBA | New Users to Excel | |||
Reading last cell | Excel Discussion (Misc queries) | |||
Reading formulae in a different cell | Excel Discussion (Misc queries) |