Copy values in a range to memory

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

Guest

Hi,

I was wondering how I could go about copying a range's values to memory.
I'm creating an audit system where I need to capture the old values and the
new values upon a change. A delete of multiple cells doesn't seem to be
captured.

Can you use 2-D arrays in Excel's VBScript?

Thanks,
Ryan
 
nevermind...I got it ;)

ReDim OldValueArray(1 To Target.Rows.Count, 1 To Target.Columns.Count)
 
you can use a 2d array like this:

dim myArray() as string
dim rng as range
dim x as integer

set rng = ("your range")

redim myArray(1 to rng.Count)

for x = LBound(myArray) to UBound(myArray)
myArray(x) = rng.cells(x)
next x


HTH

Danny
 

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

Back
Top