Hi,
I got this code from Norie earlier today, it inserts a row and copies the row above, works great, thanks.
But, I now need to delete one cell's data in each of the copied rows, the cell to delete is always going to be in column Q and will always be in the copied rows.
I tried to incorporate into Norie's code, a SendKeys function deleting the data 17 columns out to the right but it wouldn't work, any ideas ?
Thanks for your help, hope it makes sense
Steve
Sub InsertAndCopy()
Dim rng As Range
Set rng = Range("A1")
While rng.Value <> ""
If rng.Value <> rng.Offset(1).Value Then
rng.Offset(1).EntireRow.Insert
rng.EntireRow.Copy rng.Offset(1)
Set rng = rng.Offset(1)
End If
Set rng = rng.Offset(1)
Wend
End Sub
I got this code from Norie earlier today, it inserts a row and copies the row above, works great, thanks.
But, I now need to delete one cell's data in each of the copied rows, the cell to delete is always going to be in column Q and will always be in the copied rows.
I tried to incorporate into Norie's code, a SendKeys function deleting the data 17 columns out to the right but it wouldn't work, any ideas ?
Thanks for your help, hope it makes sense
Steve
Sub InsertAndCopy()
Dim rng As Range
Set rng = Range("A1")
While rng.Value <> ""
If rng.Value <> rng.Offset(1).Value Then
rng.Offset(1).EntireRow.Insert
rng.EntireRow.Copy rng.Offset(1)
Set rng = rng.Offset(1)
End If
Set rng = rng.Offset(1)
Wend
End Sub