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: 129
Default Fast way to make rows visible and invisible


My application has the following Sub which hides some rows and makes
others visible :

Is there a way to speed up this code somehow so that the cells are set
to visible and invisible in two instructions.

The code is real slow.

Public Sub RegionView(sheet As Worksheet, NavigationColumn As Long)
Dim i As Integer
Dim rowType As String
For i = STARTING_ROW_INDEX To MAXIMUM_ROW_INDEX
rowType = sheet.Cells(i, NavigationColumn).Value
If i < 2 Then
MsgBox rowType
End If
If "br_br" = rowType Then
sheet.Rows(CStr(i) + ":" + CStr(i)).EntireRow.Hidden = True
ElseIf "br_ta" = rowType Then
sheet.Rows(CStr(i) + ":" + CStr(i)).EntireRow.Hidden = True
ElseIf "rg_rg" = rowType Then
sheet.Rows(CStr(i) + ":" + CStr(i)).EntireRow.Hidden = True
ElseIf "rg_tr" = rowType Then
sheet.Rows(CStr(i) + ":" + CStr(i)).EntireRow.Hidden = False
Else
sheet.Rows(CStr(i) + ":" + CStr(i)).EntireRow.Hidden = False
End If
If i MAXIMUM_ROW_INDEX Then
Exit For
End If
Next i
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
Make a chart axis visible/invisible with VBA Jeff Reese Charts and Charting in Excel 3 April 27th 23 03:42 AM
change invisible bars back to visible hf Charts and Charting in Excel 1 July 28th 06 02:29 PM
Check Box to switch make comments visible or invisible DanHegarty Excel Discussion (Misc queries) 1 June 10th 06 04:08 PM
invisible text boxes becoming visible Jordan Excel Programming 1 February 26th 05 12:01 AM
How do I make a command button invisible or visible? Mandora Excel Programming 3 February 17th 05 08:40 PM


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