ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding Columns in Excel Sheet (https://www.excelbanter.com/excel-programming/337198-adding-columns-excel-sheet.html)

Dhiraj

Adding Columns in Excel Sheet
 
I wish to add 4 columns in an Excel Sheet on the click of a button. Can
anyone suggest or help me in doing the same ?

Vasant Nanavati

Adding Columns in Excel Sheet
 
An Excel sheet has 256 columns; no more and no less. You can't add 4
columns.

--

Vasant


"Dhiraj" wrote in message
...
I wish to add 4 columns in an Excel Sheet on the click of a button. Can
anyone suggest or help me in doing the same ?




[email protected]

Adding Columns in Excel Sheet
 
Vasant is right: you can't "Add" collumns. But if you mean "Insert"
collumns, you can do some this like this:

Sub InsCol()
Columns("E:H").Insert Shift:=xlToRight
End Sub

This will insert 4 collumns before collumn E.



All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com