karl_learnvba
New Member
- Joined
- Oct 10, 2019
- Messages
- 12
- Office Version
- 365
- Platform
- Windows
I have data in 1 row that I would like ot create a table from.
The final table will be approx 9 cells wide.
If I were cutting and pasting the data manually I would :-
1) Select all items in the row from active cell to the far right (ativecell is L8 in the attached screenshot)
2) Cut
3) Paste below previous data
I got this far before running out of ideas I am seing an error in the pasting function towards the end
Can somebody please help ? Thanks in advance !
Sub Macro1()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
' Cut & paste the Data
Dim cutRange As Range
Set cutRange = ws.Range(ActiveCell, ActiveCell.End(xlToRight))
cutRange.Cut
ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
End Sub
The final table will be approx 9 cells wide.
If I were cutting and pasting the data manually I would :-
1) Select all items in the row from active cell to the far right (ativecell is L8 in the attached screenshot)
2) Cut
3) Paste below previous data
I got this far before running out of ideas I am seing an error in the pasting function towards the end
Can somebody please help ? Thanks in advance !
Sub Macro1()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
' Cut & paste the Data
Dim cutRange As Range
Set cutRange = ws.Range(ActiveCell, ActiveCell.End(xlToRight))
cutRange.Cut
ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
End Sub