Share via

Insert Row in Excel for conditional with macro

Anonymous
2012-08-18T06:46:51+00:00

Hello

I just want to know that how can I do the Follow Application in Excel 2007 with Macro.

At first find all of cells that included    "*"   then insert row for each of those.

Regards,

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-08-18T08:39:53+00:00

TediVQ,

Maybe you could adapt from this: I put some text strings in A1:A8, some of which included the * character. Running this code inserts a new line below those cells which contain a *

Sub insrt_below()

Dim c As Range

For Each c In Range("A1:A8")

    If InStr(1, c, "*", vbTextCompare) > 0 Then

        Rows(c.Offset(1, 0).Row & ":" & c.Offset(1, 0).Row).Insert shift:=xlDown

    End If

Next c

End Sub

Is that close to what you wanted?

___________

Regards, Tom

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2012-08-18T10:26:49+00:00

    Hi

    Thanks a lot,This is the same answer what i needed.

    Regards,

    Was this answer helpful?

    0 comments No comments