Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Right click on the sheet tab in questions and choose View Code from
the popup menu. That will open the code module for that worksheet. There, paste the following: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count 1 Then Exit Sub End If If Not Application.Intersect(Range("A2"), Target) Is Nothing Then Application.EnableEvents = False If Target.HasFormula = False Then If IsNumeric(Target.Value) Then If Target.Value 0 And _ Target.Value < Me.Rows.Count Then Me.Rows(Target.Value).Insert End If End If End If Application.EnableEvents = True End If End Sub Change the reference to "A2" to the cell whose value controls which row to insert. Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Thu, 20 May 2010 08:29:01 -0700, Bilbo Baggs <Bilbo wrote: Hi, I need to be able to insert a new row into a worksheet at row 'x' where 'x' is determined by the value in a particular cell. So e.g. if the user enters the number '34' into cell A2 I want to be able to wite a short macro that will when run insert a new row into the worksheet at row 34. I just cannot find a way to automate the process of selecting the require row number? Strugling with this for hours - would appreciate any help. This is my first ever online question. Hope it makes sense. Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Making the AND function look at only part of a cell entry | Excel Discussion (Misc queries) | |||
Show value from specific column based on location of active cell | Excel Discussion (Misc queries) | |||
Pop up message upon specific cell entry? | Excel Discussion (Misc queries) | |||
Info from one cell making other cells active | Excel Worksheet Functions | |||
Making Cell Entry Mandatory | Excel Discussion (Misc queries) |