Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Hide rows using VBA

Private Sub Workbook_Open()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 1 To iLastRow 'iLastRow to 1 Step -1
.Rows(i).Hidden = (.Cells(i, TEST_COLUMN).Offset(0, 2).Value =
"HIDE")
Next i
End With

End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"buzzandbeyond" wrote in message
ups.com...
Hi,

I am trying to hide rows with a specific value.

In my sheet I have three columns:
Date - The manually inputted date
Today - 1 Month - 'TODAY() -31' (this column will be hidden)
In Range? - an IF statement to say "HIDE" or SHOW" (this column will
be hidden)

I am looking to hide all the rows where Hide shows in the In Range?
column. I would also like this to run on opening the document

Any advice is gratefully received as my vba skills are almost non
existent.

cheers
Dave



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
Group rows (or hide rows) like in MS Project Annie1904 Excel Worksheet Functions 2 October 17th 09 05:15 AM
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Specify which rows to NOT hide, and have excel hide the rest Mo2 Excel Programming 0 April 25th 07 03:44 AM
Hide Rows - copy and paste only rows that show Access101 Excel Worksheet Functions 3 March 1st 06 12:39 AM


All times are GMT +1. The time now is 10:33 AM.

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

About Us

"It's about Microsoft Excel"