silentwolf
Well-known Member
- Joined
- May 14, 2008
- Messages
- 1,216
- Office Version
- 2016
Hi guys,
I like to copy an entire row and paste that row above found row if condition is met.
this is what I got so far but how do I need to ad the paste line into that code?
so i like to find the number 1 in column G and copy that row above that row.
Idealy I like to change the value of the call in column C to 156 and the rest of the row values should stay the same.
Many thanks for your help!!
Cheers Albert
I like to copy an entire row and paste that row above found row if condition is met.
this is what I got so far but how do I need to ad the paste line into that code?
Code:
Sub InsertCopiedRowAboveNumerberOne()
Dim lngZeile As Long
Dim lngZeileMax As Long
With ActiveSheet
lngZeileMax = .UsedRange.Rows.Count
For lngZeile = lngZeileMax To 2 Step -1
If .Cells(lngZeile, 7).Value = 1 Then
.Cells.EntireRow.Copy
.Rows(lngZeile).EntireRow.Insert
End If
Next lngZeile
End With
End Sub
so i like to find the number 1 in column G and copy that row above that row.
Idealy I like to change the value of the call in column C to 156 and the rest of the row values should stay the same.
Many thanks for your help!!
Cheers Albert