Losing my mind over "call" macro

LoneStarPiper

New Member
Joined
Mar 29, 2019
Messages
4
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
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
13,849
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
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
 

LoneStarPiper

New Member
Joined
Mar 29, 2019
Messages
4
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,736
Messages
5,597,815
Members
414,178
Latest member
Octavian Manoli

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
Top