#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Delete hidden cells

Is there a macro that will delete all hidden rows within a range?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Delete hidden cells

Maybe...

Option Explicit
Sub testme()
dim delRng as range
dim myCell as range
dim myRng as range

with worksheets("sheet9999")
set myrng = .range("a1:a99")
end with

for each mycell in myrng.columns(1).cells
if mycell.entirerow.hidden = true then
if delrng is nothing then
set delrng = mycell
else
set delrng = union(mycell, delrng)
end if
end if
next mycell

if delrng is nothing then
'nothing to do
else
delrng.entirerow.delete
end if

end sub

You'll want to change the worksheet name and the range address.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

brownti wrote:

Is there a macro that will delete all hidden rows within a range?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Delete hidden cells

thanks, that worked perfect!!


Dave Peterson wrote:
Maybe...

Option Explicit
Sub testme()
dim delRng as range
dim myCell as range
dim myRng as range

with worksheets("sheet9999")
set myrng = .range("a1:a99")
end with

for each mycell in myrng.columns(1).cells
if mycell.entirerow.hidden = true then
if delrng is nothing then
set delrng = mycell
else
set delrng = union(mycell, delrng)
end if
end if
next mycell

if delrng is nothing then
'nothing to do
else
delrng.entirerow.delete
end if

end sub

You'll want to change the worksheet name and the range address.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Is there a macro that will delete all hidden rows within a range?



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
Calculating only non-empty cells... Jay Excel Worksheet Functions 9 September 22nd 06 03:20 AM
Formula to delete blank cells across multiple columns? SamFunMail Excel Worksheet Functions 2 September 1st 05 07:05 AM
how to delete contents of cells having specific data steve Excel Discussion (Misc queries) 2 July 20th 05 10:42 PM
paste over hidden cells KyWilde Excel Discussion (Misc queries) 0 May 20th 05 12:50 AM
Calculating without including Hidden Cells LiquidFire Excel Discussion (Misc queries) 3 November 29th 04 08:35 PM


All times are GMT +1. The time now is 08:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"