I have the following code which works correctly, but I will need to replicate it and alter it slightly 15 times to refer to different pages. Is it possible to alter this code so that it looks at the previous sheet to the one that I am on. My actual spreadsheet consists of 5 core pages and I need to extract information from those pages onto 15 other sheets. The call routines will be very similar and where possible I want to store routine tasks in sub routines that I can easily call when needed. This coding refers to column on sheet 7 which is obtaining information from sheet 6. later I will be creating sheets 8 and 9 and will need to lookup data on sheet 8 that needs to be placed into sheet 9. I hope this makes sense.
I have copied the full code below for information but the key element that need adapting is
VLOOKUP(RC[-14],'W & G List'!R1C13:R22C14,2,FALSE
I would be grateful fo any assistance is how I could adapt this.
Kind regards
Marion
full code for information is
Sub preparelabels()
Dim rw As Long
rw = Range("c65536").End(xlUp).row
Range("R1") = "Code"
Range("R2:r" & rw).FormulaR1C1 = "=if(iserror(VLOOKUP(RC[-14],'W & G List'!R1C13:R22C14,2,FALSE)),"""",vLOOKUP(RC[-14],'W & G List'!R1C13:R22C14,2,FALSE))"
End Sub
I have copied the full code below for information but the key element that need adapting is
VLOOKUP(RC[-14],'W & G List'!R1C13:R22C14,2,FALSE
I would be grateful fo any assistance is how I could adapt this.
Kind regards
Marion
full code for information is
Sub preparelabels()
Dim rw As Long
rw = Range("c65536").End(xlUp).row
Range("R1") = "Code"
Range("R2:r" & rw).FormulaR1C1 = "=if(iserror(VLOOKUP(RC[-14],'W & G List'!R1C13:R22C14,2,FALSE)),"""",vLOOKUP(RC[-14],'W & G List'!R1C13:R22C14,2,FALSE))"
End Sub