Hi all,
I have a sheet like this (sorry about all the borders):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]
[TABLE="width: 131"]
<tbody>[TR="class: grid"]
[TD](Nobody) (0)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 72"]
<tbody>[TR="class: grid"]
[TD]sometext
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]
[TABLE="width: 131"]
<tbody>[TR="class: grid"]
[TD]Steve Smith (888)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 72"]
<tbody>[TR="class: grid"]
[TD]attribute 1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]
[TABLE="width: 131"]
<tbody>[TR="class: grid"]
[TD]Jane Smith (787)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 72"]
<tbody>[TR="class: grid"]
[TD]sometext
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]
[TABLE="width: 131"]
<tbody>[TR="class: grid"]
[TD](Nobody) (0)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 72"]
<tbody>[TR="class: grid"]
[TD]sometext
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
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):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]
[TABLE="width: 131"]
<tbody>[TR="class: grid"]
[TD](Nobody) (0)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 72"]
<tbody>[TR="class: grid"]
[TD]sometext
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]
[TABLE="width: 131"]
<tbody>[TR="class: grid"]
[TD]Steve Smith (888)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 72"]
<tbody>[TR="class: grid"]
[TD]attribute 1
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]
[TABLE="width: 131"]
<tbody>[TR="class: grid"]
[TD]Jane Smith (787)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 72"]
<tbody>[TR="class: grid"]
[TD]sometext
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]
[TABLE="width: 131"]
<tbody>[TR="class: grid"]
[TD](Nobody) (0)
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]
[TABLE="width: 72"]
<tbody>[TR="class: grid"]
[TD]sometext
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
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!