This code will work if the table is the only data in the active worksheet. It depends on using UsedRange to figure out what columns are being used, and if there is any data to the right of the table it will add it there instead of the table.
Sub TestMacro()
Dim NewColumn As Long
NewColumn = UsedRange.Columns.Count + 1
Cells(12, NewColumn) = InputBox("Name")
Cells(13, NewColumn) = InputBox("Northing")
Cells(14, NewColumn) = InputBox("Easting")
Cells(15, NewColumn) = InputBox("Transition Length (Ls)")
Cells(16, NewColumn) = InputBox("Minimum Radius (Rc)")
Cells(17, NewColumn) = InputBox("Central Angle (DELTA)")
End Sub
You will notice that instead of selecting a cell, then acting on the ActiveCell, this code assigns the value directly to the cell. Your code is typical of what a macro recorder will do, although the approach here is best practice.
I also used Cells instead of Range. It can be done with Range, but when your target column is a number instead of a letter this is more direct.
Bookmarks