How to use Macro to delete this row??

  • Thread starter Thread starter kamikazi
  • Start date Start date
K

kamikazi

What am I suppose to put this <> section to get the row deleted?
I tried writing < Opp.Offset(0, 1).Selection.EntireRow.Delete>
but it's not working. Please advise.

Dim shC As Object, shD As Object, Opp As Object, BPRole As Object,
As Long, k As Long

Dim ops As Object

Set shC = Sheets("Results")
Set shD = Sheets("New")
'Name of the spreadsheets

For j = shD.Range("B500").End(xlUp).Row To 1 Step -1
Set Opp = shD.Cells(j, 11)
Set BPRole = shD.Cells(j, 7)
If (Opp >= 100000) And (BPRole = "BPA") Then

<>

End If
Next
 
What am I suppose to put this said:
I tried writing < Opp.Offset(0, 1).Selection.EntireRow.Delete>
but it's not working. Please advise.

Dim shC As Object, shD As Object, Opp As Object, BPRole As Object, j
As Long, k As Long

Dim ops As Object

Set shC = Sheets("Results")
Set shD = Sheets("New")
'Name of the spreadsheets

For j = shD.Range("B500").End(xlUp).Row To 1 Step -1
Set Opp = shD.Cells(j, 11)
Set BPRole = shD.Cells(j, 7)
If (Opp >= 100000) And (BPRole = "BPA") Then

<>

End If
Next j

try this:

If (Opp < 100000) And (BPRole <> "BPA") Then
shD.Rows(j).Delete
End If

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top