Excel Move Cells to Right.
Solved/Closed
j3kj3k
Posts
15
Registration date
Tuesday 1 June 2010
Status
Member
Last seen
11 July 2012
-
15 Jun 2010 à 17:25
j3kj3k Posts 15 Registration date Tuesday 1 June 2010 Status Member Last seen 11 July 2012 - 17 Jun 2010 à 12:04
j3kj3k Posts 15 Registration date Tuesday 1 June 2010 Status Member Last seen 11 July 2012 - 17 Jun 2010 à 12:04
Related:
- Excel Move Cells to Right.
- Excel mod apk for pc - Download - Spreadsheets
- Excel arrow keys not moving cells - Guide
- Excel move data from one sheet to another - Guide
- Kernel for excel repair - Download - Backup and recovery
- Vat calculation excel - Guide
2 responses
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
16 Jun 2010 à 20:20
16 Jun 2010 à 20:20
Try this
Sub MoveData()
Dim lRow As Long
Dim iMaxCol As Integer
Dim lMaxRow As Long
Dim iCol As Integer
Dim Cell As Range
Dim sValue As Variant
iMaxCol = Cells(1, Columns.Count).End(xlToLeft).Column
Set Cell = Cells.Find("*", Cells(1, 1), SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
If Cell Is Nothing Then Exit Sub
For lRow = 2 To Cell.Row
For iCol = iMaxCol To 2 Step -1
If Cells(lRow, iCol) = "" Then
sValue = Cells(lRow, iCol).End(xlToLeft)
Cells(lRow, iCol).End(xlToLeft) = ""
Cells(lRow, iCol) = sValue
End If
Next iCol
Next lRow
End Sub
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
15 Jun 2010 à 19:52
15 Jun 2010 à 19:52
On what basis would column shift. In your example some did and some did not.
j3kj3k
Posts
15
Registration date
Tuesday 1 June 2010
Status
Member
Last seen
11 July 2012
16 Jun 2010 à 13:21
16 Jun 2010 à 13:21
Hi, Rizvisa1
That was my bad. I have updated the spread sheet. Basically move all none balck cell next to last column (not concatenate).
Thanks
That was my bad. I have updated the spread sheet. Basically move all none balck cell next to last column (not concatenate).
Thanks
17 Jun 2010 à 12:04