View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Greg Wilson Greg Wilson is offline
external usenet poster
 
Posts: 747
Default Macro to insert row.

Have you tested mine? Mine does this.

Regards,
Greg

"Steve" wrote:

The value 991CX will not always be in a10. It will always be in column A.
Just not always row 10. I am looking for something that will search col. A
for 991CX, when found, insert a blank row above it. Sorry for the confusion
guys.

Steve

"Rowan" wrote:

One way is like this:

Sub InsRow()
With Range("A10")
If .Value = "991CX" Then
.EntireRow.Insert
End If
End With
End Sub

otherwise:

Sub InsRow()
If Cells(10, 1).Value = "991CX" Then
Cells(10, 1).EntireRow.Insert
End If
End Sub

Hope this helps
Rowan


Hope this helps
Rowan

"Steve" wrote:

I would like to set up a macro to insert a blank row at specific spots in a
worksheet. For example, if cell a10 contains 991CX, i would like to have a
blank row inserted directly above it. Thanks in advance for any help you are
able to offer.

Steve