Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete hidden cells
Is there a macro that will delete all hidden rows within a range?
|
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calculating only non-empty cells... | Excel Worksheet Functions | |||
Formula to delete blank cells across multiple columns? | Excel Worksheet Functions | |||
how to delete contents of cells having specific data | Excel Discussion (Misc queries) | |||
paste over hidden cells | Excel Discussion (Misc queries) | |||
Calculating without including Hidden Cells | Excel Discussion (Misc queries) |