Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Guys for all the answers.
Regards Prasad Vanka sbakker wrote: Well this is how I would do it quick and dirty ;) Code: -------------------- Sub RmvBlanks() Dim rngMyRange As Range Dim rngCurRow As Range Dim lCount, lInnerCount As Long Dim lColumns As Long Set rngMyRange = Selection lColumns = rngMyRange.Columns.Count 'Loop through each row of selection For Each rngCurRow In rngMyRange.Rows lInnerCount = 1 'Loop through each column of the current row For lCount = 1 To lColumns 'If Cell is no empty copy the value to the next open cell from the left If rngCurRow.Columns(lCount) < vbNullString Then rngCurRow.Columns(lInnerCount) = rngCurRow.Columns(lCount) If lInnerCount < lCount Then rngCurRow.Columns(lCount) = "" End If lInnerCount = lInnerCount + 1 End If Next lCount Next rngCurRow End Sub -------------------- -- sbakker ------------------------------------------------------------------------ sbakker's Profile: http://www.excelforum.com/member.php...o&userid=23645 View this thread: http://www.excelforum.com/showthread...hreadid=373072 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Row Height Adjustment on data Imported into excel | Excel Worksheet Functions | |||
Code Adjustment | Excel Discussion (Misc queries) | |||
Using Cell Data as adjustment to formula references | Excel Worksheet Functions | |||
formula adjustment | Excel Worksheet Functions | |||
VBA adjustment for beginner | Excel Programming |