LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert Columns based on cell value

put the foolwoing code in the worksheet module

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row = 1 And IsNumeric(Target.Value) Then
If Target.Value 0 Then
Range(Cells(1, Target.Column + 1).Address, Cells(1,
Target.Column + Target.Value).Address).EntireColumn.Insert
End If
End If

End Sub


- Mangesh


---
Message posted from http://www.ExcelForum.com/

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert an image based on a cell value brig239 New Users to Excel 1 June 3rd 09 07:10 PM
Insert value based on color of the cell aberdonian user Excel Worksheet Functions 3 December 17th 07 07:47 PM
Insert a value in a cell based upon a comparison of cell values in 2 separate worksheets Doctorjones_md Excel Discussion (Misc queries) 7 June 8th 07 09:32 PM
Insert a value in a cell based upon a comparison of cell values in 2 separate worksheets Doctorjones_md Excel Worksheet Functions 7 June 8th 07 09:32 PM
how do I insert a cell based on its match with an adjacent cell? Gabbon Excel Worksheet Functions 12 January 24th 06 12:28 PM


All times are GMT +1. The time now is 12:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"