anastabation
New Member
- Joined
- Jul 4, 2007
- Messages
- 22
I am new to this coding caper and I am desperate to learn.
I've got an excel sheet that has a whole bunch of data and it changes year to year. What I need to do is copy, paste special the previous years data, then change the variables to come up with current years data and then compare figures.
The problem is that the data is in a number of rows. Currently my code looks like this.
It doesn't run too slowly but it is very long and very messy. It also doesn't allow the flexibility to alter the spreadsheet.
I've tried playing around with loops but had no success. I've done a sample worksheet to show waht I want but don't know how to attach files.
Any help would be greatly appreciated.
I've got an excel sheet that has a whole bunch of data and it changes year to year. What I need to do is copy, paste special the previous years data, then change the variables to come up with current years data and then compare figures.
The problem is that the data is in a number of rows. Currently my code looks like this.
Code:
Range("C7:T7").Copy
Range("AA7").PasteSpecial Paste:=xlValues
Range("C10:t10").Copy
Range("AA10").PasteSpecial Paste:=xlValues
Range("C13:T13").Copy
Range("AA13").PasteSpecial Paste:=xlValues
Range("C16:t16").Copy
Range("AA16").PasteSpecial Paste:=xlValues
Range("C19:t19").Copy
Range("AA19").PasteSpecial Paste:=xlValues
Range("C24:t24").Copy
Range("AA24").PasteSpecial Paste:=xlValues
Range("C27:t27").Copy
Range("AA27").PasteSpecial Paste:=xlValues
Range("C30:T30").Copy
Range("AA30").PasteSpecial Paste:=xlValues
Range("C33:T33").Copy
Range("AA33").PasteSpecial Paste:=xlValues
Range("C36:T36").Copy
Range("AA36").PasteSpecial Paste:=xlValues
Range("C39:T39").Copy
Range("AA39").PasteSpecial Paste:=xlValues
Range("C42:T42").Copy
Range("AA42").PasteSpecial Paste:=xlValues
Range("C45:T45").Copy
Range("AA45").PasteSpecial Paste:=xlValues
Range("C48:T48").Copy
Range("AA48").PasteSpecial Paste:=xlValue
Range("C51:t51").Copy
Range("AA51").PasteSpecial Paste:=xlValues
Range("C54:T54").Copy
Range("AA54").PasteSpecial Paste:=xlValues
Range("C57:T57").Copy
Range("AA57").PasteSpecial Paste:=xlValues
Range("C60:T60").Copy
Range("AA60").PasteSpecial Paste:=xlValues
Range("C63:T63").Copy
Range("AA63").PasteSpecial Paste:=xlValues
Range("C66:T66").Copy
Range("AA66").PasteSpecial Paste:=xlValues
Range("C69:t69").Copy
Range("AA69").PasteSpecial Paste:=xlValues
Range("C72:t72").Copy
Range("AA72").PasteSpecial Paste:=xlValues
Range("C75:t75").Copy
Range("AA75").PasteSpecial Paste:=xlValues
Range("C78:t78").Copy
Range("AA78").PasteSpecial Paste:=xlValues
Range("C81:T81").Copy
Range("AA81").PasteSpecial Paste:=xlValues
Range("C84:T84").Copy
Range("AA84").PasteSpecial Paste:=xlValues
Range("C97:T97").Copy
Range("AA97").PasteSpecial Paste:=xlValues
Range("C100:T100").Copy
Range("AA100").PasteSpecial Paste:=xlValues
Range("C106:T106").Copy
Range("AA106").PasteSpecial Paste:=xlValues
Range("C109:T109").Copy
Range("AA109").PasteSpecial Paste:=xlValues
Range("C112:t112").Copy
Range("AA112").PasteSpecial Paste:=xlValues
Range("C118:t118").Copy
Range("AA118").PasteSpecial Paste:=xlValues
Range("C121:t121").Copy
Range("AA121").PasteSpecial Paste:=xlValues
It doesn't run too slowly but it is very long and very messy. It also doesn't allow the flexibility to alter the spreadsheet.
I've tried playing around with loops but had no success. I've done a sample worksheet to show waht I want but don't know how to attach files.
Any help would be greatly appreciated.