Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Deleting blanks Marianne Excel Discussion (Misc queries) 10 September 10th 08 10:29 AM
Deleting Rows and Shifting Up - Repost D.Parker Excel Discussion (Misc queries) 14 October 11th 07 04:58 AM
Deleting and shifting cells and columns Curt1521 Excel Worksheet Functions 7 May 8th 06 04:14 PM
Deleting cells and shifting "right" CDWhite Excel Discussion (Misc queries) 5 April 15th 06 02:50 AM
Auto Update upon shifting, inserting or deleting Tracy B Excel Worksheet Functions 2 April 6th 05 08:37 PM


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