El Matador
New Member
- Joined
- May 31, 2011
- Messages
- 6
Hey guys,
Please bear with me as I don't have that much experience with excel. Im trying to create a macro that will select certain data from one worksheet and paste it into another. I got through this fine but hit a roadblock when I tried to get it to do the same for the row.
Basically, what I need it to do is to copy certain data from sheet 1 (called Master Sheet) to sheet 2 (Called feed sheet). Each row from sheet 1 should correspond to the same row in sheet 2. I would like the loop to continue until there is no more data.
this is what my macro is looking like at the moment (ugly, I know)
Sub DataImport()
'
' DataImport Macro
' Macro recorded 5/31/2011 by Jesus Fernandez
'
Range("E4").Select
Selection.Copy
Sheets("Feed Sheet").Select
Range("B4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("A4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("A4").Select
ActiveSheet.Paste
Range("C4").Select
Sheets("Master Sheet").Select
Range("J4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("L4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("D4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
ActiveWindow.SmallScroll ToRight:=9
Range("Q4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("E4").Select
ActiveSheet.Paste
Range("F4").Select
Sheets("Master Sheet").Select
Range("S4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("T4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("G4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("V4").Select
Columns("V:V").ColumnWidth = 11.86
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("H4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
ActiveWindow.SmallScroll ToRight:=8
Columns("AD:AD").ColumnWidth = 18.14
Range("AD4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("I4").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll ToRight:=7
Sheets("Master Sheet").Select
ActiveWindow.SmallScroll ToRight:=8
Range("AK4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("J4").Select
ActiveSheet.Paste
Range("K4").Select
Sheets("Master Sheet").Select
Range("AL4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
ActiveWindow.SmallScroll ToRight:=9
Range("AT4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("L4").Select
ActiveSheet.Paste
Columns("K:K").ColumnWidth = 23.43
Columns("J:J").ColumnWidth = 29.43
Columns("K:K").ColumnWidth = 27.71
Columns("K:K").ColumnWidth = 34.29
Columns("L:L").ColumnWidth = 15.71
Sheets("Master Sheet").Select
Range("AU4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("M4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("AV4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("N4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("AS28").Select
End Sub
I apologize in advance if it's something that's been covered before, I did a search and tried some of the suggestions without much success.
Thanks!
Please bear with me as I don't have that much experience with excel. Im trying to create a macro that will select certain data from one worksheet and paste it into another. I got through this fine but hit a roadblock when I tried to get it to do the same for the row.
Basically, what I need it to do is to copy certain data from sheet 1 (called Master Sheet) to sheet 2 (Called feed sheet). Each row from sheet 1 should correspond to the same row in sheet 2. I would like the loop to continue until there is no more data.
this is what my macro is looking like at the moment (ugly, I know)
Sub DataImport()
'
' DataImport Macro
' Macro recorded 5/31/2011 by Jesus Fernandez
'
Range("E4").Select
Selection.Copy
Sheets("Feed Sheet").Select
Range("B4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("A4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("A4").Select
ActiveSheet.Paste
Range("C4").Select
Sheets("Master Sheet").Select
Range("J4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("L4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("D4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
ActiveWindow.SmallScroll ToRight:=9
Range("Q4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("E4").Select
ActiveSheet.Paste
Range("F4").Select
Sheets("Master Sheet").Select
Range("S4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("T4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("G4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("V4").Select
Columns("V:V").ColumnWidth = 11.86
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("H4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
ActiveWindow.SmallScroll ToRight:=8
Columns("AD:AD").ColumnWidth = 18.14
Range("AD4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("I4").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll ToRight:=7
Sheets("Master Sheet").Select
ActiveWindow.SmallScroll ToRight:=8
Range("AK4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("J4").Select
ActiveSheet.Paste
Range("K4").Select
Sheets("Master Sheet").Select
Range("AL4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
ActiveWindow.SmallScroll ToRight:=9
Range("AT4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("L4").Select
ActiveSheet.Paste
Columns("K:K").ColumnWidth = 23.43
Columns("J:J").ColumnWidth = 29.43
Columns("K:K").ColumnWidth = 27.71
Columns("K:K").ColumnWidth = 34.29
Columns("L:L").ColumnWidth = 15.71
Sheets("Master Sheet").Select
Range("AU4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("M4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("AV4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Feed Sheet").Select
Range("N4").Select
ActiveSheet.Paste
Sheets("Master Sheet").Select
Range("AS28").Select
End Sub
I apologize in advance if it's something that's been covered before, I did a search and tried some of the suggestions without much success.
Thanks!