Hi all,
I have the following Macro but want to clean it up,
Essentially it inputs a cycle step Number on one sheet then copies the values in a named range and pastes them into a another sheet by selecting a named range.
Any help is much appreciated.
The code Module is in the following link.
https://drive.google.com/file/d/1GgQy94KFthbQ_swWMtNXrYQWqIUUbmqZ/view?usp=sharing
A slimmed down version is pasted below.
I have the following Macro but want to clean it up,
Essentially it inputs a cycle step Number on one sheet then copies the values in a named range and pastes them into a another sheet by selecting a named range.
Any help is much appreciated.
The code Module is in the following link.
https://drive.google.com/file/d/1GgQy94KFthbQ_swWMtNXrYQWqIUUbmqZ/view?usp=sharing
A slimmed down version is pasted below.
Code:
Sub Run_ALL_1()
'
' ALL_1() Macro
'
Sheets("Data Input").Select
Range("S41").Select
ActiveCell.FormulaR1C1 = "1"
Range("S44").Select
ActiveCell.FormulaR1C1 = "Load 1"
Application.ScreenUpdating = False
Application.Goto Reference:="MC_P"
Selection.Copy
Sheets("MC_P").Select
Application.Goto Reference:="Cycle_1"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="MC_SB"
Selection.Copy
Sheets("MC_SB").Select
Application.Goto Reference:="Cycle_1"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="T_C_M"
Selection.Copy
Sheets("T_C_M").Select
Application.Goto Reference:="Cycle_1"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="A_F_RZ_P"
Selection.Copy
Sheets("A_F_RZ_P").Select
Application.Goto Reference:="Cycle_1"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="A_F_RZ_SB"
Selection.Copy
Sheets("A_F_RZ_SB").Select
Application.Goto Reference:="Cycle_1"
ActiveSheet.Paste
Sheets("Data Input").Select
Range("S41").Select
ActiveCell.FormulaR1C1 = "2"
Application.Goto Reference:="MC_P"
Selection.Copy
Sheets("MC_P").Select
Application.Goto Reference:="Cycle_2"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="MC_SB"
Selection.Copy
Sheets("MC_SB").Select
Application.Goto Reference:="Cycle_2"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="T_C_M"
Selection.Copy
Sheets("T_C_M").Select
Application.Goto Reference:="Cycle_2"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="A_F_RZ_P"
Selection.Copy
Sheets("A_F_RZ_P").Select
Application.Goto Reference:="Cycle_2"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="A_F_RZ_SB"
Selection.Copy
Sheets("A_F_RZ_SB").Select
Application.Goto Reference:="Cycle_2"
ActiveSheet.Paste
Sheets("Data Input").Select
Range("S41").Select
ActiveCell.FormulaR1C1 = "3"
Application.Goto Reference:="MC_P"
Selection.Copy
Sheets("MC_P").Select
Application.Goto Reference:="Cycle_3"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="MC_SB"
Selection.Copy
Sheets("MC_SB").Select
Application.Goto Reference:="Cycle_3"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="T_C_M"
Selection.Copy
Sheets("T_C_M").Select
Application.Goto Reference:="Cycle_3"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="A_F_RZ_P"
Selection.Copy
Sheets("A_F_RZ_P").Select
Application.Goto Reference:="Cycle_3"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="A_F_RZ_SB"
Selection.Copy
Sheets("A_F_RZ_SB").Select
Application.Goto Reference:="Cycle_3"
ActiveSheet.Paste
Sheets("Data Input").Select
Range("S41").Select
ActiveCell.FormulaR1C1 = "4"
Application.Goto Reference:="MC_P"
Selection.Copy
Sheets("MC_P").Select
Application.Goto Reference:="Cycle_4"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="MC_SB"
Selection.Copy
Sheets("MC_SB").Select
Application.Goto Reference:="Cycle_4"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="T_C_M"
Selection.Copy
Sheets("T_C_M").Select
Application.Goto Reference:="Cycle_4"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="A_F_RZ_P"
Selection.Copy
Sheets("A_F_RZ_P").Select
Application.Goto Reference:="Cycle_4"
ActiveSheet.Paste
Sheets("Data Input").Select
Application.Goto Reference:="A_F_RZ_SB"
Selection.Copy
Sheets("A_F_RZ_SB").Select
Application.Goto Reference:="Cycle_4"
ActiveSheet.Paste
Application.ScreenUpdating = True
Sheets("Data Input").Select
Range("S41").Select
ActiveCell.FormulaR1C1 = "-10"
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Summary").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Summary", "Calculation Sheet", "Data Input", "MC_P", "MC_SB", "T_C_M", _
"A_F_RZ_P", "A_F_RZ_SB", "A_F_RX_P", "A_F_RX_SB", "MCP_FZ_P", "MCP_FZ_SB", "MCP_FX_P" _
, "MCP_FX_SB", "AFP_FZ_P", "AFP_FZ_SB", "AFP_FX_P", "AFP_FX_SB", "G_RZ1", "G_RZ2", _
"G_RZ3", "G_RZ4", "G_RX1_2", "G_RX3_4", "Summary Info")).Select
Sheets("Summary").Activate
Sheets(Array("A-Frame Cylinder Loads", "A-FRAME Cylinder Load")).Select Replace _
:=False
Range("A1").Select
Sheets("Data Input").Select
End Sub
Last edited by a moderator: