Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I did a macro inside a module to be called in the formula bar.
Basically, I have a drop down list of models in a cell (A1) that user can select, which will show the detailed desciption of the selected model in the next row (A2). I included an item of "Non-Standard model", so that if user choose that item, I could hide the standard model's row (A2) and show the non-standard one (A3). My function is as follows: Function LookupCorrespond(ByVal Source As String, ByVal LookupList As Range, ByRef StandardRow As Long, ByRef NonStandardRow As Long) As String Model = Application.WorksheetFunction.VLookup(Source, LookupList, 2, False) If (Application.WorksheetFunction.IsError(Model)) Then LookupCorrespond = "" Else Application.ScreenUpdating = False If (StrComp(Model, "Non-Standard", vbStringCompare) Eqv 0) Then Rows(StandardRow & ":" & StandardRow).Hidden = True Rows(NonStandardRow & ":" & NonStandardRow).Hidden = False Else Rows(StandardRow & ":" & StandardRow).Hidden = False Rows(NonStandardRow & ":" & NonStandardRow).Hidden = True End If Application.ScreenUpdating = True LookupCorrespond = CStr(Model) End If End Function The description showing part works beautifully, but it doesn't seems to be able to hide & unhide the desired rows at all. ANyone can point out anything wrong? Thanks! ________ cLiffordiL |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help hiding macro work | Excel Programming | |||
Simple hiding columns with vba does not work with a checkbox | Excel Programming | |||
Bound column does not work after hiding form | Excel Programming | |||
Hiding "work" taking place on a worksheet. | Excel Programming | |||
Hiding and Unhiding work sheets | Excel Programming |