R
ryguy7272
I lost my train of thought and now I’m stuck. I’m trying to figure out a way
to insert rows dynamically. The logic is to look for this text: ‘Enter
non-listed privately held securities or groups of assets by asset class.’
Then I need to go up to find the first cell ABOVE that contains this text
'CUSIP', then offset (1,0) . . . ActiveCell.EntireRow.Insert AND copy the
format from the row above. I have CUSIP in ColA with DataValidation on this
cell. I want to copy that format down 1 row and I have a few other cells to
the right, with other formatting, all on the same row; I want to copy this
formatting down when the row is inserted.
Here’s the non-working code that I have now:
Private Sub CommandButton3_Click()
CovRow = 0
For x = 20 To 200
If InStr(Cells(x, 1), "Enter non-listed" & "*") <> 0 Then
CovRow = x
End If
Next x
If CovRow > 1 Then
CovRow.Select
Selection.Resize(1, 25).Select
ActiveCell.EntireRow.Insert
End If
End Sub
I'm very open to ideas as to how to do this!
Thanks everyone!!
to insert rows dynamically. The logic is to look for this text: ‘Enter
non-listed privately held securities or groups of assets by asset class.’
Then I need to go up to find the first cell ABOVE that contains this text
'CUSIP', then offset (1,0) . . . ActiveCell.EntireRow.Insert AND copy the
format from the row above. I have CUSIP in ColA with DataValidation on this
cell. I want to copy that format down 1 row and I have a few other cells to
the right, with other formatting, all on the same row; I want to copy this
formatting down when the row is inserted.
Here’s the non-working code that I have now:
Private Sub CommandButton3_Click()
CovRow = 0
For x = 20 To 200
If InStr(Cells(x, 1), "Enter non-listed" & "*") <> 0 Then
CovRow = x
End If
Next x
If CovRow > 1 Then
CovRow.Select
Selection.Resize(1, 25).Select
ActiveCell.EntireRow.Insert
End If
End Sub
I'm very open to ideas as to how to do this!
Thanks everyone!!