How can I add a row to a work sheet when I reach the last row in my worksheet? The row has many steps and formulas in it.
I would like to have a new row added when ever a new (reqistration number) col a1 is added.
Last edited by Genebu; 02-01-2012 at 11:25 AM. Reason: solved
Hi Genebu
you can modify this worksheet event code to suit
Private Sub Worksheet_Change(ByVal Target As Range) Dim TargetCell As Range, N As Long On Error GoTo FormulaFillFail If (Not IsNumeric(Target.Value)) Or IsEmpty(Target) Then Exit Sub End If For Each TargetCell In Intersect(ActiveSheet.UsedRange, Target.EntireRow) If TargetCell.Value = "" Then For N = 1 To TargetCell.Row - 1 If TargetCell.Offset(-N, 0).HasFormula Then TargetCell.Offset(-N, 0).Copy Destination:=TargetCell.Offset(-N + 1, 0).Resize(N, 1) Exit For End If Next N End If Next TargetCell Exit Sub FormulaFillFail: End Sub
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
Look at Formatting as a Table
Last edited by royUK; 01-28-2012 at 05:27 AM.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks