Macro to Move all data in Cols B:G in same Row as in Col A

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I would like a macro to move all data from Col B:G into same row as in Col A (those rows in Col A are blank where there is data in Cols B:G)


Your assistance is most appreciated
 
Hi Joe

I recorded a macro to move the data into Col A per your suggestion

the code works perfectly, but would like this amended so that Range("A7").Activate is amended to be the first blank cell in Col A selected




Code:
 Sub MoveData_ColBOnwards()
Sheets("Data Import").Select
 Columns("A:A").Select
    Range("A7").Activate
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.Delete Shift:=xlToLeft
End Sub
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You can do it like this:
VBA Code:
Sub MoveData_ColBOnwards()

    Dim rng1 As Range
    Dim rng2 As Range

'   Find blanks in column A
    Sheets("Data Import").Select
    Set rng1 = Columns("A:A").SpecialCells(xlCellTypeBlanks)
    
'   Remove first 6 rows
    Set rng2 = Intersect(rng1, Range("A7:A" & Rows.Count))
    
'   Delete blanks
    rng2.Delete Shift:=xlToLeft
    
End Sub
 
Upvote 0
You are welcome.

So does that work for you?
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,688
Members
448,978
Latest member
rrauni

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top