Vijayonline2008
New Member
I have created a new macro for shifting multiple columns of data to single column, given below. The problem is if there are so many columns it will take so much time to execute. I heard if we use an array it will be much faster. any one have any idea how to that
Sub Multiple_to_single()
Application.ScreenUpdating = False
Dim lastcoloumn As Long
lastcoloumn = ActiveSheet.UsedRange.Columns.Count
lastcoloumn = lastcoloumn - 1
For counter = 1 To lastcoloumn
ActiveCell.Offset(0, counter).Activate
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Cut
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Next counter
Application.ScreenUpdating = False
End Sub
Sub Multiple_to_single()
Application.ScreenUpdating = False
Dim lastcoloumn As Long
lastcoloumn = ActiveSheet.UsedRange.Columns.Count
lastcoloumn = lastcoloumn - 1
For counter = 1 To lastcoloumn
ActiveCell.Offset(0, counter).Activate
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Cut
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Next counter
Application.ScreenUpdating = False
End Sub