View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default How to return to selected cell?

Hi
try something like

sub foo()
dim rng as range
set rng = selection
'...
'insert your code
'...
rng.select
end sub



--
Regards
Frank Kabel
Frankfurt, Germany

milt wrote:
I want to write a macro in VBA such that when a user selects a cell
on a worksheet the macro will run, do stuff, and then return to the
cell selected by the user. What I can't figure out is how to return
to the cell selected by the user. This is probably simple but I'm
rather new to VBA and would very much appreciate some help.

Milt