Suppose I have the worksheet below:
Empid EmpName Sal 1 david 100 2 jhon 200 3 steve 300
How can I insert a new column named "Loc"?
Empid EmpName Loc Sal 1 david uk 100 2 jhon us 200 3 steve nj 300
To insert a single column: Right-click the whole column to the right of where you want to add the new column, and then select Insert Columns. To insert multiple columns: Select the same number of columns to the right of where you want to add new ones. Right-click the selection, and then select Insert Columns.
On your computer, open a spreadsheet in Google Sheets. Select a row, column, or cell. Right-click the row, column, or cell. From the menu that appears, select Insert 1 left, right, above or below.
Click the letter of the column you want to change and then the "Formulas" or "General" on your computer. Select "Define Name" under the Defined Names group in the Ribbon to open the New Name window. Enter your new column name in the text box.
To insert a column using a VBA code, you need to use the “Entire Column” property with the “Insert” method. With the entire column property, you can refer to the entire column using a cell and then insert a new column. By default, it will insert a column before the cell that you have mentioned.
Use insert method from range, for example
Sub InsertColumn() Columns("C:C").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove Range("C1").Value = "Loc" End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With