![]() |
macro to hide a row when a cell contains a value
I have an excel sheet that contains multiple rows. I want to be able to
hide/unhide the rows that contain "C" (complete) when there is a "C" in column P when I click on the command button that contains the macro |
macro to hide a row when a cell contains a value
Sub HideMe()
n = Cells(Rows.Count, "P").End(xlUp).Row For i = 1 To n If Cells(i, "P").Value = "C" Then Rows(i).EntireRow.Hidden = True End If Next End Sub -- Gary''s Student - gsnu200814 "InfoNeeded" wrote: I have an excel sheet that contains multiple rows. I want to be able to hide/unhide the rows that contain "C" (complete) when there is a "C" in column P when I click on the command button that contains the macro |
All times are GMT +1. The time now is 11:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com