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: 12
Default Row Hiding doesn't Seems to Work

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
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
Help hiding macro work justaguyfromky Excel Programming 1 January 4th 05 01:45 AM
Simple hiding columns with vba does not work with a checkbox Brian Excel Programming 3 January 9th 04 10:39 PM
Bound column does not work after hiding form TerryK[_2_] Excel Programming 5 December 10th 03 03:21 AM
Hiding "work" taking place on a worksheet. mika.[_2_] Excel Programming 2 November 20th 03 02:19 AM
Hiding and Unhiding work sheets Frank[_19_] Excel Programming 3 November 19th 03 11:27 PM


All times are GMT +1. The time now is 04:47 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"