How to install your new code
- Copy the Excel VBA code
- Select the workbook in which you want to store the Excel VBA code
- Press Alt+F11 to open the Visual Basic Editor
- Choose Insert > Module
- Edit > Paste the macro into the module that appeared
- Close the VBEditor
- Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
Sub MoveDataToColumns()
Dim rResult As Range
On Error Resume Next
Set rResult = Application.InputBox("Select Cell From Where Paste should Happen", "Cell Selection Req.", , , , , , 8)
On Error GoTo 0
'
If Not rResult Is Nothing Then
Application.ScreenUpdating = False
Set rResult = rResult.Cells(1)
For Each r In Range("A:A").SpecialCells(xlCellTypeConstants).Areas
r.Copy rResult
Set rResult = rResult.Offset(, 1)
Next r
Application.ScreenUpdating = True
End If
End Sub
To run the Excel VBA code:- Press Alt-F8 to open the macro list
- Select a macro in the list
- Click the Run button
Bookmarks