Managing User Changes

P

Peter

Hi,
I am using VB.NET and have an app that does a DB query and displays the
results in excel. I want the app to monitor where the results are stored ie.
if the user inserts columns or rows the app still knows where the original
data is stored.

I can use the SheetChange event to monitor when a cell is changed, but I am
unsure about the best way to do this, particularly when the event is fired
for both the cut and paste operations.

Should I 'catch' the cut, store the details of contained cells, then 'catch'
the paste and update my app then?

If so, how can I tell what the user has done? Is there something saved
somewhere to highlight the operation?

Thanks for any help,
Peter.
 
T

Tom Ogilvy

Create a defined name that refers to the cell, then you can use that defined
name to refer to the cell.

Turn on the macro recorder while you do it manually to get the code.

Insert=>Name=>Define
Name: Range1
Refersto: =Sheet1!$B$9

then in code

msgbox Range("Range1").Address & " - " & Range("Range1").Value
 

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