Macro Clean Up

cdoc83

New Member
Joined
Oct 1, 2012
Messages
4
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.

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:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top