tangychips
New Member
- Joined
- Feb 2, 2016
- Messages
- 5
I made some code using the recorder and have attempted to tweak it. Finding it difficult to get any more gains from it as I am very new to all this (using the macro recorder was a huge step).
There is another macro very similar to this so if I could get help with this one, I could reverse engineer the changes and fix the other one myself. If someone could help thin out the code, I would be very gracious!
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Sheets("Enter Data").Range("C3").Copy
Sheets("Products").Select
Range("B1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("C4").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("C5").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("C6").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 7).Range("A1").Select
Sheets("Enter Data").Select
Range("C7").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("C8").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 3).Range("A1").Select
Sheets("Enter Data").Select
Range("C9").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 2).Range("A1").Select
Sheets("Enter Data").Select
Range("E1").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("D1").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Dim rngData As Range, rngFormula As Range
With ThisWorkbook.Worksheets("Products")
Set rngData = .Range("B1:B" & .Cells(.Rows.Count, "B").End(xlUp).Row)
Set rngFormula = .Range("F2:K2")
rngFormula.AutoFill _
Destination:=.Range(rngFormula, _
.Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column))
End With
With ThisWorkbook.Worksheets("Products")
Set rngData = .Range("B1:B" & .Cells(.Rows.Count, "B").End(xlUp).Row)
Set rngFormula = .Range("N2:O2")
rngFormula.AutoFill _
Destination:=.Range(rngFormula, _
.Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column))
End With
With ThisWorkbook.Worksheets("Products")
Set rngData = .Range("B1:B" & .Cells(.Rows.Count, "B").End(xlUp).Row)
Set rngFormula = .Range("Q2:Q3")
rngFormula.AutoFill _
Destination:=.Range(rngFormula, _
.Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column))
End With
Sheets("Enter Data").Select
Range("C3").Select
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
There is another macro very similar to this so if I could get help with this one, I could reverse engineer the changes and fix the other one myself. If someone could help thin out the code, I would be very gracious!
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Sheets("Enter Data").Range("C3").Copy
Sheets("Products").Select
Range("B1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("C4").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("C5").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("C6").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 7).Range("A1").Select
Sheets("Enter Data").Select
Range("C7").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("C8").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 3).Range("A1").Select
Sheets("Enter Data").Select
Range("C9").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
ActiveCell.Offset(0, 2).Range("A1").Select
Sheets("Enter Data").Select
Range("E1").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 1).Range("A1").Select
Sheets("Enter Data").Select
Range("D1").Select
Application.CutCopyMode = True
Selection.Copy
Sheets("Products").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Dim rngData As Range, rngFormula As Range
With ThisWorkbook.Worksheets("Products")
Set rngData = .Range("B1:B" & .Cells(.Rows.Count, "B").End(xlUp).Row)
Set rngFormula = .Range("F2:K2")
rngFormula.AutoFill _
Destination:=.Range(rngFormula, _
.Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column))
End With
With ThisWorkbook.Worksheets("Products")
Set rngData = .Range("B1:B" & .Cells(.Rows.Count, "B").End(xlUp).Row)
Set rngFormula = .Range("N2:O2")
rngFormula.AutoFill _
Destination:=.Range(rngFormula, _
.Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column))
End With
With ThisWorkbook.Worksheets("Products")
Set rngData = .Range("B1:B" & .Cells(.Rows.Count, "B").End(xlUp).Row)
Set rngFormula = .Range("Q2:Q3")
rngFormula.AutoFill _
Destination:=.Range(rngFormula, _
.Cells(rngData.Rows(rngData.Rows.Count).Row, rngFormula.Column))
End With
Sheets("Enter Data").Select
Range("C3").Select
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub