Reselect cell after macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a range of cells used to input numbers 0 through 9. There are other cells that count the occurances of each number in that range (Count If 0, Count If 1, ...). After 20 entries a macro runs to copy/paste the quantity of each number ( # of 0's, # of 1's, # of 2's, ...) into 10 other cells.
Problem: How do I get Excel to reselect the cell that was selected before the macro ran? This cell could be any one in the data input range.
Any help would be greatly appreciated.
 
Hi one way:
sub foo()
Dim rng as range
set rng = activecell
....' your code
rng.select
end sub

Frank
 
Put in at the end of the macro:

Sheet1.Range("A1").Select

Change Sheet and Cell reference as needed.

Cheer
 
Frank
Works perfectly, thanks!
This discussion group is an excellent and invaluable resource.

----- Frank Kabel wrote: ----

Hi one way
sub foo(
Dim rng as rang
set rng = activecel
....' your cod
rng.selec
end su

Fran

gman wrote
 
Back
Top