Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I created an Excel VBA macro that processes a list of items in a column
As a visual aid, I modified the code to select the row of the ite being processed. But now when the macro is finished executing, the row following th last column entry remains selected/hilighted. How can I: 1) Save whatever cell(s) are selected upon entry to macro execution; 2) Restore the original selection when code is ready to exit? Many thanks in advance... Mekratri -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try sub foo() dim rng as range set rng = selection 'your code rng.select end sub -- Regards Frank Kabel Frankfurt, Germany I created an Excel VBA macro that processes a list of items in a column. As a visual aid, I modified the code to select the row of the item being processed. But now when the macro is finished executing, the row following the last column entry remains selected/hilighted. How can I: 1) Save whatever cell(s) are selected upon entry to macro execution; 2) Restore the original selection when code is ready to exit? Many thanks in advance... Mekratrig --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And if you want to restore the active cell in a multicell selection:
Public Sub foo() Dim rSelect As Range Dim rActive As Range Set rSelect = Selection Set rActive = ActiveCell 'do your thing rSelect.Select rActive.Activate End Sub In article , "Frank Kabel" wrote: Hi try sub foo() dim rng as range set rng = selection 'your code rng.select end sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi JE
good point :-) Frank -----Original Message----- And if you want to restore the active cell in a multicell selection: Public Sub foo() Dim rSelect As Range Dim rActive As Range Set rSelect = Selection Set rActive = ActiveCell 'do your thing rSelect.Select rActive.Activate End Sub In article , "Frank Kabel" wrote: Hi try sub foo() dim rng as range set rng = selection 'your code rng.select end sub . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Limiting selection in a cell AND linking that selection to a list | Excel Discussion (Misc queries) | |||
De-dup and retain new records only | Excel Worksheet Functions | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
retain cell formatting | Excel Discussion (Misc queries) | |||
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. | Excel Programming |