How to store Range for "home-made" Undo Function?

J

Joe HM

Hello -

I have restriced inserting and deleting rows on a Worksheet to make
users use functionality of a custom toolbar. That way I can make sure
that formatting stays consistent.

I am now trying to make an undo function after the deletion of a row.
Currently I store the .Value and other . entries in global variables
but it seems like there should be an esier way.

I tried to define a ...
Public mRange as Range
and then assign ...
Set mRange = lSheet.Range(...)
.... but when I try to access mRange from within another function, it
seems to have lost all the data.

How can I create a copy of the range and store it in a variable in
order to restore it later on?

Thanks,
Joe
 
W

Wigi

Joe, what is often done, is use an extra hidden worksheet (xlHidden or
xlVeruHidden) where you store some data.
 
J

Joe HM

Hello -

That might work for me ... I need to check it out. It's just a little
weird that there seems to be no other way to do this ...

Thanks!
Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top