Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need help fixing the following code. Basically, if the user answers "no",
then I want to hide all of the rows in the worksheet that have a "v" in column "A". I'm new to VBA but am learning thanks to everyone's help. Thanks! Randy Select Case ProjectSize Case Is = "l", "m" resp = MsgBox("Will a vendor be used for this project?", vbYesNo) If resp = vbYes Then vendor = "" Else vendor = "v" For Each row In ActiveSheet.UsedRange.Rows If row.cell = vendor Then row.Hidden = True End If Next row End If End Select |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try this. modify range to suit
Sub hidevendor() Rows.Hidden = False ans = MsgBox("will a vendor be used", vbYesNo) If ans = vbNo Then ' MsgBox "hi" For Each c In Range("a2:a23") If c = "v" Then c.EntireRow.Hidden = True Next c End If End Sub -- Don Guillett SalesAid Software "Randy" wrote in message ... I need help fixing the following code. Basically, if the user answers "no", then I want to hide all of the rows in the worksheet that have a "v" in column "A". I'm new to VBA but am learning thanks to everyone's help. Thanks! Randy Select Case ProjectSize Case Is = "l", "m" resp = MsgBox("Will a vendor be used for this project?", vbYesNo) If resp = vbYes Then vendor = "" Else vendor = "v" For Each row In ActiveSheet.UsedRange.Rows If row.cell = vendor Then row.Hidden = True End If Next row End If End Select |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
show a number of rows based upon user input | Excel Discussion (Misc queries) | |||
Hiding worksheets based on user selection | Excel Worksheet Functions | |||
Hiding columns based on user/password | Excel Worksheet Functions | |||
CODE to select range based on User Input or Value of Input Field | Excel Programming | |||
Hiding worksheets based on user permissions | Excel Programming |