With help from Wigi, I have a nice little chunk of code that does some work for me. It utilizes two workbooks. One is like the master file, the second is a data file with 15 sheets or so. I am trying to keep from copying and pasting by allowing the code to pick up the sheet name (which is used on the master list) in stead of repeating the code a 15 times with a different sheet name.
Make sense? I hope.
Here is the beginning of my code (the red is where I'm stuck):
Dim rCell As Range
Dim mysheet As Excel.Sheets
Windows("FY12-Q3 Value Tracker Key Measure Summary Tables FINAL.xlsm").Activate
Sheets("Store Level Value").Select
'Total Respondents, NBP-PBP-NBQ-PBQ
For Each rCell In Range("B4:B10").Cells
Set mysheet = rCell.Offset(0, -1).Value
With Workbooks("FY12-Q3 Data Tables.xlsx").Sheets(mysheet).Columns(1)
Set c = .Find("[Q6]", LookIn:=xlValues)
Set c = .Find(rCell, After:=c)
Set c = .Find("Bottom 2 (NET)", After:=c)
End With
rCell.Offset(0, 11).Value = c.Offset(, 14).Value
rCell.Offset(0, 20).Value = c.Offset(, 3).Value
rCell.Offset(0, 21).Value = c.Offset(, 12).Value
rCell.Offset(0, 22).Value = c.Offset(, 15).Value
Next
Thanks in advance!
Make sense? I hope.
Here is the beginning of my code (the red is where I'm stuck):
Dim rCell As Range
Dim mysheet As Excel.Sheets
Windows("FY12-Q3 Value Tracker Key Measure Summary Tables FINAL.xlsm").Activate
Sheets("Store Level Value").Select
'Total Respondents, NBP-PBP-NBQ-PBQ
For Each rCell In Range("B4:B10").Cells
Set mysheet = rCell.Offset(0, -1).Value
With Workbooks("FY12-Q3 Data Tables.xlsx").Sheets(mysheet).Columns(1)
Set c = .Find("[Q6]", LookIn:=xlValues)
Set c = .Find(rCell, After:=c)
Set c = .Find("Bottom 2 (NET)", After:=c)
End With
rCell.Offset(0, 11).Value = c.Offset(, 14).Value
rCell.Offset(0, 20).Value = c.Offset(, 3).Value
rCell.Offset(0, 21).Value = c.Offset(, 12).Value
rCell.Offset(0, 22).Value = c.Offset(, 15).Value
Next
Thanks in advance!