Transfer data from one worksheet to another

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

Guest

At work we have spreadsheets that we call scorecards. They contain our reps
statistics on a monthly basis for various objectives they are expected to
meet. Some of the cells are protected and won't let us even select the
locked cells.

We are on our fourth template for the year and expect to get one or two more
before the scorecard is considered complete.

What I am wanting to do is create a macro that will allow me to transfer the
data from a previous version of the same scorecard to our newest one. All
the cells that are accessible in the new one are the same as in the old one.
I merely want to create a macro that will copy the data from the one sheet to
the other without doing it manually.

I can even provide the worksheets if necessary. Help!

Thanks,
Cheri
 
Sub ABC()
Dim v as Variant, v1 as Variant, i as Long
Dim sh as Worksheet, sh1 as Worksheet
Set sh = Workbooks("NewBook.xls").Worksheets(1)
Set sh1 = Workbooks("OldBook.xls").Worksheets(3)
' New form locations
v = Array("A1","B9","C10","A6")
' Corresponding old form Locations
v1 = Array("A1","B2","F11","A3")

for i = lbound(v) to ubound(v)
sh.Cells(v(i)).Value = sh1.Cells(v1(i)).Value
Next i
End sub

define the arrays to do the mapping between forms.
 

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