View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
davesexcel
 
Posts: n/a
Default Dynamic column insert (macro)


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True 'Eliminate Edit status due to doubleclick
Target.Offset(1).EntireColumn.Insert
Target.EntireColumn.Copy Target.Offset(1).EntireColumn
On Error Resume Next
Target.Offset(1).EntireRow.SpecialCells(xlConstant s).ClearContents
On Error GoTo 0
End Sub

Here's a Worksheet macro, you will need to place it in a worksheet
module, of course it doesn't have to be a double click event, you can
move it to a button. You can also modify it to find the last column as
well


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=522562