Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, I need a macro that will hide rows if a cell in column AD is empty.
Can anyone help me? Thanks Todd |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("AD:AD").SpecialCells(xlBlanks).Entirerow.Hi dden = True
-- Regards, Tom Ogilvy "Todd" wrote in message ... Hi, I need a macro that will hide rows if a cell in column AD is empty. Can anyone help me? Thanks Todd |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You would need a toggle button for that.
If you want to have the command button toggle the rows (each time it is clicked), you can do Private Sub CommandButton1_Click() Dim rng As Range, rng1 As Range On Error Resume Next Set rng = Range("AD:AD").SpecialCells(xlBlanks) Set rng1 = Range("AD:AD").SpecialCells(xlVisible) On Error GoTo 0 Debug.Print rng.Address Debug.Print rng1.Address If Not rng Is Nothing Then If rng1.Areas.Count = 1 Then rng.EntireRow.Hidden = True Else rng.EntireRow.Hidden = False End If End If End Sub -- Regards, Tom Ogilvy "Todd" wrote in message ... Thank you Tom, I have this set to a command button and it works wonderfully. Another question about this though. I want to have the button hide when clicked and unhide if unselected too. How can somethng like this be done? Again, Thanks Todd "Tom Ogilvy" wrote: Range("AD:AD").SpecialCells(xlBlanks).Entirerow.Hi dden = True -- Regards, Tom Ogilvy "Todd" wrote in message ... Hi, I need a macro that will hide rows if a cell in column AD is empty. Can anyone help me? Thanks Todd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help on Macro to hide empty rows | Excel Discussion (Misc queries) | |||
Hide the line when cell B is empty | Excel Discussion (Misc queries) | |||
Getting a macro to see the next available empty cell | Excel Discussion (Misc queries) | |||
macro to look for empty cell | Excel Discussion (Misc queries) | |||
Macro to hide rows with empty cells | Excel Worksheet Functions |