i wasted all day trying to figure this out i have a workbook with 4 pages i need to make a macro that would hide a row only if the third column is blank.
im new to forums and to VBA
can someone help me out
i wasted all day trying to figure this out i have a workbook with 4 pages i need to make a macro that would hide a row only if the third column is blank.
im new to forums and to VBA
can someone help me out
Hello & Welcome to the Board,
How about...
Sub test() Columns("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True End Sub
HTH
Regards, Jeff
wow thanks.
now how do i unhide?
and is there a way that if the column a is blank then it should not hide it?
How about this...
The first macro will hide all rows where a cell in column C is blank and a cell in column A is not blank. Did I read your requirement right?
The second macro will unhide all rows.
Both macros will also perform this on all worksheets in your workbook.
Sub HideRow2() Dim ws As Worksheet Dim LR As Long Dim i As Long Application.ScreenUpdating = False For Each ws In ActiveWorkbook.Worksheets LR = ws.Range("C" & Rows.Count).End(xlUp).Row For i = 2 To LR If ws.Range("C" & i) = "" And Not ws.Range("A" & i) = "" Then ws.Rows(i).EntireRow.Hidden = True End If Next i Next ws Application.ScreenUpdating = True End Sub
Sub Macro1() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets ws.Cells.EntireRow.Hidden = False Next ws End Sub
Hi thanks for this. But i have column c & d. i want to hide rows only when both columns are either "0" value or "blank" value. How to write please
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks