help with macros button, running macros will work, but not in button function

lbillie

New Member
Joined
Jun 21, 2013
Messages
28
I need help with macros button, I run the macros, it will work fine. Once I copy and paste my macros to a button format it gives me an error. I got an error 1004, select method of range class failed. Can someone help me figure out what I have to do to make the button macros work? Here is my macros.

Private Sub CommandButton1_Click()
'
' LINKS Macro
'

'
Workbooks.Open Filename:= _
"P:\Procedures\Product Outlines\MEDLEY\MEDLEY_LINKS\Mcpicsw.xlsm", UpdateLinks _
:=3
ActiveWindow.WindowState = xlNormal
Sheets("HSG").Select
Sheets("Checklist").Visible = True
Sheets("Checklist").Select
ActiveWindow.SmallScroll Down:=18
Range("A41").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R41C1"
Range("A42").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R42C1"
Range("A43").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R43C1"
Range("A47").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R45C1"
Range("A48").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R46C1"
Range("A49").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R47C1"
Range("A50").Select
ActiveWindow.SmallScroll Down:=24
Range("A53").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R49C1"
Range("A54").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R50C1"
Range("A55").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R51C1"
Range("A56").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R52C1"
Range("A57").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R53C1"
Range("A61").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R55C1"
Range("A62").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R56C1"
Range("A63").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R57C1"
Range("A64").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R58C1"
Range("A68").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R60C1"
Range("A69").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R61C1"
Range("A70").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R62C1"
Range("A71").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R63C1"
Range("A72").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R64C1"
Range("A77").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R66C1"
Range("A78").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R67C1"
Range("A79").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R68C1"
Range("A80").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R69C1"
Range("A81").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R70C1"
Range("A82").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R71C1"
Range("A83").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R72C1"
Range("A90").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R74C1"
Range("A91").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R75C1"
Range("A92").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R76C1"
Range("A94").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R77C1"
Range("A95").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R78C1"
Range("A96").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R79C1"
Range("A97").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R80C1"
Range("A106").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R81C1"
Range("A107").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R82C1"
Range("A108").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R83C1"
Range("A112").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R85C1"
Range("A113").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R86C1"
Range("A117").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R88C1"
Range("A118").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R89C1"
Range("A123").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R91C1"
Range("A124").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R92C1"
Range("A126").Select
ActiveCell.FormulaR1C1 = "=[MC_WHITE_BOM_BLDR2.xlsm]Checklist!R93C1"
Range("A127").Select
ActiveWindow.WindowState = xlMinimized
ActiveWindow.WindowState = xlMaximized
End Sub
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,215,106
Messages
6,123,124
Members
449,096
Latest member
provoking

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