VBA Help, Macros are moving dropdown boxes when rows are being hidden.

sukey69

New Member
Joined
Nov 13, 2016
Messages
1
Hey Guys,

I'm running macros off a checkbox that hides a certain number of rows, but when the rows are being shown again, all the drop down boxes are bunched at the top of the range.

Here's my VBA code so you can understand what's going on.

Sub CheckBox1696_Click()


Dim mode As Boolean

mode = Sheets("Cap Gr").ProtectContents




If Range("P67") = True Then
Range("C82") = 6 'pre mf 1
Range("C88") = 6 'super 1
Range("I82") = 6 'pre mf 2
Range("E82") = 6 'post mf 1
Range("C96") = 6 'ap 1
Range("I88") = 6 'super 2
Range("I96") = 6 'ap 2
Range("K82") = 6 'mf 2
Rows("48:69").Hidden = False
ActiveSheet.Shapes("drop down 1748").Visible = True
ActiveSheet.Shapes("drop down 1751").Visible = True
ActiveSheet.Shapes("drop down 1749").Visible = True
ActiveSheet.Shapes("drop down 1746").Visible = True
ActiveSheet.Shapes("drop down 1753").Visible = True
ActiveSheet.Shapes("drop down 1755").Visible = True
ActiveSheet.Shapes("drop down 1756").Visible = True
ActiveSheet.Shapes("drop down 1773").Visible = True
ActiveSheet.Shapes("drop down 1780").Visible = True
ActiveSheet.Shapes("drop down 1781").Visible = True
ActiveSheet.Shapes("drop down 1797").Visible = True
ActiveSheet.Shapes("drop down 1798").Visible = True
ActiveSheet.Shapes("drop down 1799").Visible = True
ActiveSheet.Shapes("drop down 1800").Visible = True
ActiveSheet.Shapes("drop down 1801").Visible = True
ActiveSheet.Shapes("drop down 1802").Visible = True
ActiveSheet.Shapes("drop down 1803").Visible = True
ActiveSheet.Shapes("drop down 1804").Visible = True
ActiveSheet.Shapes("drop down 1805").Visible = True
ActiveSheet.Shapes("drop down 1806").Visible = True




Else
Range("C82") = 4 'pre mf 1
Range("C88") = 4 'super 1
Range("I82") = 4 'pre mf 2
Range("E82") = 3 'post mf 1
Range("C96") = 3 'ap 1
Range("I88") = 4 'super 2
Range("I96") = 3 'ap 2
Range("K82") = 3 'mf 2
Rows("48:69").Hidden = True
ActiveSheet.Shapes("drop down 1748").Visible = False
ActiveSheet.Shapes("drop down 1751").Visible = False
ActiveSheet.Shapes("drop down 1749").Visible = False
ActiveSheet.Shapes("drop down 1746").Visible = False
ActiveSheet.Shapes("drop down 1753").Visible = False
ActiveSheet.Shapes("drop down 1755").Visible = False
ActiveSheet.Shapes("drop down 1756").Visible = False
ActiveSheet.Shapes("drop down 1773").Visible = False
ActiveSheet.Shapes("drop down 1780").Visible = False
ActiveSheet.Shapes("drop down 1781").Visible = False
ActiveSheet.Shapes("drop down 1797").Visible = False
ActiveSheet.Shapes("drop down 1798").Visible = False
ActiveSheet.Shapes("drop down 1799").Visible = False
ActiveSheet.Shapes("drop down 1800").Visible = False
ActiveSheet.Shapes("drop down 1801").Visible = False
ActiveSheet.Shapes("drop down 1802").Visible = False
ActiveSheet.Shapes("drop down 1803").Visible = False
ActiveSheet.Shapes("drop down 1804").Visible = False
ActiveSheet.Shapes("drop down 1805").Visible = False
ActiveSheet.Shapes("drop down 1806").Visible = False




End If
' Range("D25").Select


' Sheets("Cap Gr").






End Sub

Cheers for the help
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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