First thanks in advance, you guys are great and I appreciate the help.
I have a sheet that I use to request pricing. I am a novice with VBA
I can’t make the "Hide/Unhide Empty" button work.
When cell G10 is blank I want row 10:14 to hide
When cell G16 is empty I want row 16:20 to hide
Also they the ranges need to unhide when a number is placed in either G10 or G16. Can anyone offer a VBA solution?
ANY HELP WOULD BE APPRECIATED
Last edited by chuck edwards; 01-05-2012 at 04:30 PM.
Try this..
Sub Macro1()
If Range("G10") = "" Then
Rows("10:14").EntireRow.Hidden = True
ElseIf Range("G16") = "" Then
Rows("16:20").EntireRow.Hidden = True
End If
End Sub
sorry....
..If Range("G10") = "" And Range("G16") = "" Then
I tried it and could not make it work I am sure it is my fault .
With the open Excel press Alt + F11.
Then press Alt + I + M
Copy and paste the code inside the module, after press F5 to run the macro.
marreco thank you for your help I pasted this:
Sub Macro1()
If Range("G10") = "" And Range("G16") = "" Then
Rows("10:14").EntireRow.Hidden = True
ElseIf Range("G16") = "" Then
Rows("16:20").EntireRow.Hidden = True
End If
End Sub
and did as you instructed only nothing happens. The fist assembly has a number in cell G10 and G16 IS empty so I expected to see G16 and the assosiated rows collapse but nothing. Thank you for your help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks