Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for the thoughts and learnings, Dave !
-- Max Singapore http://savefile.com/projects/236895 Downloads:21,000 Files:370 Subscribers:66 xdemechanik --- "Dave Peterson" wrote in message ... Just a note... I like to use something like this: Sub ClearNulls() dim rng as range dim itm as range dim ar as range Set rng = Selection For Each ar In rng.Areas For Each itm In ar.cells 'added .cells If Trim(itm.Value) = "" _ Then itm.ClearContents Next 'itm Next 'ar End Sub But in this case, you could drop the area portion of the code (since you're looping through each cell anyway): Sub ClearNulls() dim rng as range dim itm as range Set rng = Selection For Each itm In rng.cells If Trim(itm.Value) = "" Then itm.ClearContents end if Next 'itm end sub (I don't like the single line If statement -- especially when they take two lines <vbg.) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count Only Empty Cells AFTER Cells with Data | Excel Worksheet Functions | |||
Remove empty cells from named list / validation list | Excel Worksheet Functions | |||
remove error value when formula exists for empty cells | Excel Worksheet Functions | |||
How can I remove hidden empty text cells from Excel? | Excel Worksheet Functions | |||
data in empty cells | Excel Worksheet Functions |