Hi all,
I have a sheet like this (sorry about all the borders):
<tbody>
</tbody>
In VBA, I need to copy the rows that do not contain “(Nobody) (0)” to another sheet.
EXAMPLE1:
If Worksheets("Sheet1").Cells(i, 1).Value <> "(Nobody) (0)" Then
Worksheets("Sheet1").Rows(i).EntireRow.Copy Destination:=Worksheets("Sheet3").Range("A" & rowcounter)
Etc.
EXAMPLE2:
If Worksheets("Sheet1").Cells(i, 1).Value <> "Steve Smith (888)" Then
Worksheets("Sheet1").Rows(i).EntireRow.Copy Destination:=Worksheets("Sheet3").Range("A" & rowcounter)
Etc.
Example 1 does not work, it does not recognize the value (Nobody) (0) in a cell. It copies all rows.
Example 2 does work, it copies all rows that do not contain Steve Smith (888) in a cell.
I need example 1 to work, So I guess the code needs extra quotes or something around (Nobody) (0)
Any suggestions would be greatly appreciated!
I have a sheet like this (sorry about all the borders):
<tbody> </tbody> |
<tbody> </tbody> | ||
<tbody> </tbody> |
<tbody> </tbody> | ||
<tbody> </tbody> |
<tbody> </tbody> | ||
<tbody> </tbody> |
<tbody> </tbody> |
<tbody>
</tbody>
In VBA, I need to copy the rows that do not contain “(Nobody) (0)” to another sheet.
EXAMPLE1:
If Worksheets("Sheet1").Cells(i, 1).Value <> "(Nobody) (0)" Then
Worksheets("Sheet1").Rows(i).EntireRow.Copy Destination:=Worksheets("Sheet3").Range("A" & rowcounter)
Etc.
EXAMPLE2:
If Worksheets("Sheet1").Cells(i, 1).Value <> "Steve Smith (888)" Then
Worksheets("Sheet1").Rows(i).EntireRow.Copy Destination:=Worksheets("Sheet3").Range("A" & rowcounter)
Etc.
Example 1 does not work, it does not recognize the value (Nobody) (0) in a cell. It copies all rows.
Example 2 does work, it copies all rows that do not contain Steve Smith (888) in a cell.
I need example 1 to work, So I guess the code needs extra quotes or something around (Nobody) (0)
Any suggestions would be greatly appreciated!