Losing my mind over "call" macro

LoneStarPiper

New Member
Joined
Mar 29, 2019
Messages
15
Hello all. I have a macro that hides and unhides several rows on a sheet, and works perfectly when on I use a button ON THAT SHEET. I have another sheet that has a checkbox that when selected, should run the exact same macro and for some reason it only runs half of it. I'm losing my mind, can anyone help???

Code:
Sub InstallerCopyNOPrint()Sheets("Agreement").Rows("43:100").Hidden = Not Rows("43:100").Hidden  (THIS ONE GOES FROM NOT HIDDEN TO HIDDEN)
Sheets("Agreement").Rows("101:113").Hidden = Not Rows("101:113").Hidden (THIS ONE GOES FROM HIDDEN TO NOT HIDDEN
End Sub

Above is the code on a button in sheet called "Agreement".

On another sheet, I have check boxes to run a series of macros. When the check box is selected, this is the macro it should run:
Code:
'Installer Copy Checkbox values are 0 (false), 1 (true), 2 (changed or grey)    If Worksheets("Admin").CheckBoxes("chk3installcopies").Value = 1 Then
        Call InstallerCopyNOPrint
        Call Agreement_Print
    End If

What seems to happen is that it "hides" the first line, but doesn't "unhide" the second. Any suggestions?

LoneStarPiper
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
What happens if you change your first code to

Code:
Sub InstallerCopyNOPrint()
Sheets("Agreement").Rows("43:100").Hidden = Not Sheets("Agreement").Rows("43:100").Hidden
Sheets("Agreement").Rows("101:113").Hidden = Not Sheets("Agreement").Rows("101:113").Hidden
End Sub
 
Upvote 0
IT WORKS PERFECTLY!!!! You are the best. Thank you so much.


What happens if you change your first code to

Code:
Sub InstallerCopyNOPrint()
Sheets("Agreement").Rows("43:100").Hidden = Not Sheets("Agreement").Rows("43:100").Hidden
Sheets("Agreement").Rows("101:113").Hidden = Not Sheets("Agreement").Rows("101:113").Hidden
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

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