Hi,
I have a CSV file which has data in the incorrect columns when the report has been created as per attachment.
I have recorded the macro below which I will need to select a cell in column N before activating the macro, instead of activating the macro x amount of times until I've gone through the whole workbook, I would like to be able to press the macro once and the whole sheet has been done then go to cell A1 if possible.
Sub AlignData()
'
' AlignData Macro
'
'
Range("N2").Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Find(What:="CONT_ADV", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -2).Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveCell.Range("A1:I1").Select
Selection.Cut
Selection.End(xlToLeft).Select
ActiveCell.Offset(0, 6).Range("A1").Select
ActiveSheet.Paste
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 1).Range("A1").Select
End Sub
Thank you very much for looking into this, it is greatly appreciated.
Regards,
Bookmarks