hamistasty
Board Regular
- Joined
- May 17, 2011
- Messages
- 208
I'm trying to make a button that transfers all the raw data in each row of that tab into a template tab that replicates itself and transfers the data of each row over until there are no rows left to transfer. In sheet1 each row contains a set of data that I'm copying and pasting into a template in the next excel tab called FIC001.
Basically, the raw data is copied and pasted into specific cells, then the FIC001 page is replicated into a new tab using 'create a copy', then the sheet1 tab is selected the same is done to the next row of data into that newly created copy of FIC001.
So basically a loop of what I've said that ends when column C in Sheet1 is blank. The end result of Sheet1 with all the raw data and then x number of tabs in the workbook with that template replicated and each row of data input into each tab.
Could I please get a hand with this? My google-fu fails, and I can't work out how to loop it.
This is all I have:
Basically, the raw data is copied and pasted into specific cells, then the FIC001 page is replicated into a new tab using 'create a copy', then the sheet1 tab is selected the same is done to the next row of data into that newly created copy of FIC001.
So basically a loop of what I've said that ends when column C in Sheet1 is blank. The end result of Sheet1 with all the raw data and then x number of tabs in the workbook with that template replicated and each row of data input into each tab.
Could I please get a hand with this? My google-fu fails, and I can't work out how to loop it.
This is all I have:
Code:
Sub create()
'
' create Macro
'
'
Range("B1").Select
Selection.Copy
Sheets("FIC001").Select
Range("C4:E4").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("C5:E5").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("H4:J4").Select
ActiveSheet.Paste
Range("C8:J8").Select
Sheets("Sheet1").Select
Range("A5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("I14:J14").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("C14:E14").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("C5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("H11:J11").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("D5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("C11:E11").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("E5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("F10").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("F5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("I10:J10").Select
Sheets("Sheet1").Select
ActiveWindow.SmallScroll Down:=-9
Sheets("FIC001").Select
Range("C10:D10").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("G5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("I10:J10").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("H5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("C7:E7").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("I5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("H7:J7").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("J5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("C15:E15").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("K5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("FIC001").Select
Range("C8:J8").Select
ActiveSheet.Paste
Sheets("FIC001").Select
' Sheets.Add After:=Sheets(Sheets.Count)
Sheets("FIC001").Copy After:=Sheets(2)
End Sub