Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sub test()
Worksheets("Sheet1").Unprotect password:="test" myrange = Worksheets("Sheet1").Cells.SpecialCells(xlCellType LastCell).Column Cells(1, myrange).EntireColumn.Insert (xlRight) Worksheets("Sheet1").Protect password:="test" End Sub There's no need to drag the contents to the next column as the Insert statement includes the term xlRight (ie insert these cells and move the displaced cells to the right). Ian "Gaurav" wrote in message ... Hi All, I am looking for a Macro that unprotects the sheet using a password, drags the last populated column to the next column and then protects the sheet using the same password. Thanks in advance. Gaurav |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why the column code in my excel is 123... instead of ABC...? | Excel Discussion (Misc queries) | |||
Excell dragging formula to change sheet/tab not column/row | Excel Worksheet Functions | |||
"Absolute" questions when autofilling-dragging down the column not | Excel Worksheet Functions | |||
Need keystrokes equivalent to dragging one column heading onto ano | Excel Discussion (Misc queries) | |||
dragging a formula down a column | Excel Worksheet Functions |