I have this problem.. I am running a VBA Code on An Excel Sheet , What it does is
It looks for Names that start with known String like ( American –land Or American –state )in Column B . If it finds it. It cuts the whole Row to a different sheet. The cods run perfect. My problem is I want to make the code understands that I would like the to cut all the words that start with “ American” and all the text after the “-“ dash.
This is part the code
Set rngdestination = Worksheets("sheet1".Range("A1"
For i = Cells(Rows.Count, "B".End(xlUp).Row To 1 Step -1
If Cells(i, "B".Value = "American -* " then ------this is the problem
Cells(i, "B".EntireRow.Copy Destination:=rngdestination
Set rngdestination = rngdestination.Offset(rngdestination.Rows.Count)
Cells(i, "B".EntireRow.Delete
End If
Please help
It looks for Names that start with known String like ( American –land Or American –state )in Column B . If it finds it. It cuts the whole Row to a different sheet. The cods run perfect. My problem is I want to make the code understands that I would like the to cut all the words that start with “ American” and all the text after the “-“ dash.
This is part the code
Set rngdestination = Worksheets("sheet1".Range("A1"
For i = Cells(Rows.Count, "B".End(xlUp).Row To 1 Step -1
If Cells(i, "B".Value = "American -* " then ------this is the problem
Cells(i, "B".EntireRow.Copy Destination:=rngdestination
Set rngdestination = rngdestination.Offset(rngdestination.Rows.Count)
Cells(i, "B".EntireRow.Delete
End If
Please help