Thread: Code assistance
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim May Jim May is offline
external usenet poster
 
Posts: 430
Default Code assistance

I've selected A5:D10, then run the following macro:
(The range has multiple blank cells scattered throughout
and I'd like to eliminate the blank cells and pull all to the
leftmost as contiguous cells. One of my rows which only
has a value in D7 doesn't make it over to A7 (it gets moved to only B7..)
Any sugestions?

Sub Macro3()
' Macro3 Macro
' Macro recorded/edited 7/24/2005 by Jim May
Set Rng = Selection
For Each bcell In Rng
If bcell = "" Then
bcell.Delete Shift:=xlToLeft
End If
Next
End Sub