Forum Discussion
Excel380
Apr 15, 2022Copper Contributor
Kindly help
I exported a file in Excel that shows two columns with min income and Max income. Now when I exported the file, Excel made three columns in total where I see majorly figures are in 2 columns but a fe...
OliverScheurich
Apr 15, 2022Gold Contributor
Sub shift()
Dim i As Integer
Dim lngzeilemax As Integer
lngzeilemax = Cells(Rows.Count, 2).End(xlUp).Row
For i = 1 To lngzeilemax
If Cells(i, 1).Value = "" Then
Cells(i, 1).Delete shift:=xlToLeft
Else
End If
Next i
End SubMaybe with these lines of code. Click the button in cell E3 in the attached file to start the macro.
- Excel380Apr 15, 2022Copper Contributor
OliverScheurich any way to do this without macros in Excel?
- OliverScheurichApr 15, 2022Gold Contributor
=IF($A1<>"",A1,B1)Maybe with this formula. The formula is entered in cell D1 in the attached example and copied across range D1:E46. Now you can copy this range and paste only values. Then you can delete columns A, B and C.