Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting blanks and shifting left - cont.
Thanks for the efforts. I have tied them all but nothing is working.
Maybe it has to do with the enire range being selected. If there is a charator in the column the blanks in that column does not get selected by means of goto/special/blanks . Is there a way to go through each cell in a range, check if it is blank if so delete it and shift left? --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting blanks and shifting left - cont.
JRB
Did you have a go at my post? It will do exactly what you want in an instant SuperJas. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting blanks and shifting left - cont.
SuperJas,
Thank you, yes I did try it and I couldn't get it to work either. Maybe I am doing something wrong. When run it doesn't appear to d anything. I select the range and then run the macro and nothing. I a just stumped. Jef -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting blanks and shifting left - cont.
Sounds like you cells are not really blank, but just appear blank.
Dim rng as Range, cell as Range, i as Long set rng = Selection.Columns(1).Cells for i = rng(rng.count).row to rng(1).row step -1 set cell = cells(i,rng.column) if len(trim(cell.Text)) = 0 then cell.Delete Shift:=xlShiftToLeft end if Next -- Regards, Tom Ogilvy "jrb " wrote in message ... Thanks for the efforts. I have tied them all but nothing is working. Maybe it has to do with the enire range being selected. If there is a charator in the column the blanks in that column does not get selected by means of goto/special/blanks . Is there a way to go through each cell in a range, check if it is blank if so delete it and shift left? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting blanks | Excel Discussion (Misc queries) | |||
Deleting Rows and Shifting Up - Repost | Excel Discussion (Misc queries) | |||
Deleting and shifting cells and columns | Excel Worksheet Functions | |||
Deleting cells and shifting "right" | Excel Discussion (Misc queries) | |||
Auto Update upon shifting, inserting or deleting | Excel Worksheet Functions |