LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default using a value in a cell to hide rows

I want to make a macro that will recognize a value in a cell and then hide
rows that I don't need.

for example: cell is J20

If I put into the cell the value of "A1" then hide rows 11:20
"A2" hides rows 21:30
"B1" hides rows 11:30
and of course nothing in the cell does not hide anything.

I found a little format in the FAQ's section, but it was not very helpful. I
adusted it to try to see if it would work for me, but upon trying it, nothing
happened. Either it doesn't automatically tie itself to the cell and I have
to activate the thing or I'm not doing it right. Most likely the latter.

Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("J20")) Is Nothing Then
Exit Sub
Else
Rows("11:20").Select
Selection.EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$10"

End Sub

 
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
auto-hide rows, cell format (# and @), update cell refs, shade cel Mo2 Excel Discussion (Misc queries) 0 April 17th 07 03:44 AM
hide rows where cell condition is not met amaries Excel Worksheet Functions 1 January 9th 07 06:50 PM
Hide Rows if cell value is mohd21uk via OfficeKB.com New Users to Excel 1 May 16th 06 03:23 PM
hide rows when the cell is #VALUE! barkiny Excel Worksheet Functions 1 March 10th 06 03:06 PM
hide rows if cell=0 Paiolas Excel Programming 2 September 8th 03 07:14 PM


All times are GMT +1. The time now is 12:43 PM.

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"