Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Slow Running Code to Hide Blank Rows

Hello All,

I am using the following code below to hide rows if cells in the range are
blank. It performs the function I desire better than any other solution I
tried. However, it runs slow (~10 seconds) and a cell in the sheet has to be
clicked to run the code if the blank cells in the range have changed and it
then runs everytime a cell in the sheet is clicked or edited.

Is there a way to speed it up greatly?
and/or
have it automatically update / update on change in the range only?
and/or
not run every time a cell in the sheet is clicked/edited?

I am a novice programmer.

Thank you for any help!

Option Compare Text

Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim cell As Range
Application.ScreenUpdating = False
With ActiveSheet.UsedRange

.Rows.Hidden = False
For Each cell In Range("A18:A98")
If cell.Value = "" Then _
cell.EntireRow.Hidden = True
Next cell
End With
End Sub
Reply
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
Slow VBA code....Hide/Unhide Loop Tami Excel Worksheet Functions 2 August 4th 09 01:53 AM
VBA code to hide blank rows ub Excel Worksheet Functions 4 July 31st 08 01:44 PM
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) Thulasiram[_2_] Excel Programming 4 September 26th 06 04:15 AM
Hide Blank Rows dee Excel Worksheet Functions 2 May 17th 06 11:30 PM
code running super slow... gaba Excel Programming 3 November 20th 04 02:35 AM


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