Greetings,
I am attempting to write a macro in Excel 2010 that pulls a lengthy number of specifications data from a master list and copy/pastes that data into new tabs. Each new tab will be for one specification (IE: Oxygen Level) and will list all the lot numbers and their respective data for that specification. I have written the VBA code to pull everything I need and copy/paste into new tabs etc., but what I cannot do, is to write it in that the macro loops or continues to pull, copy/paste for EACH lot for each specification. My macro is only able to preform the task for the 1st lot number only and then stops.
Here is a sample of my code:
Sub ComplianceMacroTest()
'
Application.ScreenUpdating = False
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Data").Range("A6:F7").Copy Destination:=Worksheets(Sheets.Count).Range("A6")
Sheets("Data").Range("C1:F5").Copy Destination:=Worksheets(Sheets.Count).Range("C1")
Sheets("Data").Range("A8:F8").Copy Destination:=Worksheets(Sheets.Count).Range("A8")
Cells.Columns.AutoFit
Cells.Columns.HorizontalAlignment = xlCenter
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Data").Range("A6:F7").Copy Destination:=Worksheets(Sheets.Count).Range("A6")
Sheets("Data").Range("G1:J7").Copy Destination:=Worksheets(Sheets.Count).Range("C1")
Sheets("Data").Range("A8:F8").Copy Destination:=Worksheets(Sheets.Count).Range("A8")
Sheets("Data").Range("G8:J8").Copy Destination:=Worksheets(Sheets.Count).Range("C8")
Cells.Columns.AutoFit
Cells.Columns.HorizontalAlignment = xlCenter
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Data").Range("A6:F7").Copy Destination:=Worksheets(Sheets.Count).Range("A6")
Sheets("Data").Range("K1:N7").Copy Destination:=Worksheets(Sheets.Count).Range("C1")
Sheets("Data").Range("A8:F8").Copy Destination:=Worksheets(Sheets.Count).Range("A8")
Sheets("Data").Range("K8:N8").Copy Destination:=Worksheets(Sheets.Count).Range("C8")
Cells.Columns.AutoFit
Cells.Columns.HorizontalAlignment = xlCenter
The "Data" sheet has all of the specifications on one sheet and lists all lot numbers in column B. The rest of the code is written to find and copy/ paste the first lot for each specification and then paste it into a new tab with the header and criteria for that specification. I am just honestly awful at macro writing but know enough to be dangerous! LOL. Any help you can provide would amazing! Thanks so much in advance.
Bookmarks