PDA

View Full Version : Merging Cell EntireRow.Insert Excel 2003



VNouBA
05-17-2012, 08:44 AM
I need to merge cells from this following VB Code


If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("B5:B100")) Is Nothing Then
NumRows = Target.Value - 1
For R = 1 To NumRows
Target.Offset(1, 0).EntireRow.Insert
Next R


The Column will be P

So if "004" is inserted in B5 then Column P Cell 5, 6, 7 and 8 will Merge.

Help from you genius is always appreciated

Bob Phillips
05-17-2012, 10:00 AM
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("B5:B100")) Is Nothing Then
numrows = Target.Value
Target.Offset(1, 0).Resize(numrows).EntireRow.Insert
Me.Cells(Target.Row, "P").Resize(numrows).Merge
End If

VNouBA
05-17-2012, 10:16 AM
Works like a charm, xld you are a talented one