Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide and lock cell formulas without affecting Macro? Mike Excel Discussion (Misc queries) 4 May 23rd 08 11:53 PM
Hide a Macro [email protected] Excel Discussion (Misc queries) 2 July 26th 07 09:12 AM
macro to hide row with 0.00 Lori Excel Worksheet Functions 2 April 25th 07 08:56 PM
Formula or Macro to hide a row based on a cell value JP Excel Discussion (Misc queries) 0 February 3rd 06 06:10 PM
macro to hide rows if cell is blank Shooter Excel Worksheet Functions 3 September 28th 05 10:55 PM


All times are GMT +1. The time now is 07:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"