![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 4
|
how do I conditionally hide a row? for example if b5="Jack" then the entire row should be hidden. Pls help.. Thanks in advance
|
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
2 questions; 1) How is b5 being changed ? via formula or user input ? 2) What do you want to happen if b5 does not = 5 |
|
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Posts: 4
|
user inputs this data. I am looking for something like this
if b5:b10="Jack" or "Molly" then hide that particular row(s) |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Right-click on your sheet tab, choose view code, paste this in there... Tom |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
Sub Hide_Rows()
On Error GoTo Z Sheets("B W").Select Range("A1:R500").Select Selection.Interior.ColorIndex = xlNone Range("A1").Select Application.ScreenUpdating = False Rw = 1 '>>>>>>>>>>>>>>>>>>>> With Sheets("B W") For Hide1 = 1 To WorksheetFunction.CountIf(.Columns("M:M"), "PAID") Set RHIDEFoundCell = .Columns("M:M").Find(What:="PAID", _ After:=.Cells(Rw, 13)) RHIDEFoundCell.EntireRow.Hidden = True Rw = RHIDEFoundCell.Row Next Hide1 End With '>>>>>>>>>>>>>>>>>>>>> Range("A1").Select Application.ScreenUpdating = True Z: End Sub edit as needs be (rare i post VBA thisis one i use ever day, just add as many as you need and link to command button, targets sloe systems, so i choose command) *MARKER HIDE ROWS*
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#6 |
|
New Member
Join Date: May 2002
Posts: 40
|
Is there a reason why you are not using an autofilter? Wouldn't it be simpler?
|
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
my code knows no limits just add add add.. and trigger on command
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|