P
project manager
I have this code, its all ok unitl the last if part.
I'm trying to add a number of rows at the bottom populated row depend on the
number in J and last cell.
any help cheers?
Sub InsertDataintoBlank()
IngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For lngRow = 1 To lngLastRow
If Trim(Range("A" & lngRow)) <> "" Then
strData = Range("A" & lngRow)
Else
Range("A" & lngRow) = strData
End If
Next
If Range("A" & IngLastRow).Value > 0 Then
Rows(IngLastRow, IngLastRow + (Range("J" & IngLastRow).Value)).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Else
End If
End Sub
I'm trying to add a number of rows at the bottom populated row depend on the
number in J and last cell.
any help cheers?
Sub InsertDataintoBlank()
IngLastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
For lngRow = 1 To lngLastRow
If Trim(Range("A" & lngRow)) <> "" Then
strData = Range("A" & lngRow)
Else
Range("A" & lngRow) = strData
End If
Next
If Range("A" & IngLastRow).Value > 0 Then
Rows(IngLastRow, IngLastRow + (Range("J" & IngLastRow).Value)).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Else
End If
End Sub