Exclude a row when searching table values

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,731
Office Version
  1. 2007
Platform
  1. Windows
My worksheet has headers at Row 4
Row 5 is hidden
All my value are then Row 6 & down the page.
This above is Table 30

I use this code below to find a blank cell in column N
The code does what its supposed to all apart from one issue.

The issue is that it always obvioulsy finds Row 5

Rich (BB code):
    Dim myRange As Range
    Set myRange = Range("Table23").ListObject.DataBodyRange
    For Each myCell In Intersect(Columns("N"), myRange) ' COLUMN WITH NO INVOICE NUMBER
    If IsEmpty(myCell) Then
      With Range("A" & myCell.Row)
        If MsgBox("EMPTY INVOICE CELL LOCATED AT ROW: " & myCell.Address(0, 0) & vbCr & vbCr & _
          "THE CUSTOMER IS : " & .Value & vbCr & vbCr & _
          "IS THIS THE CUSTOMER YOU ARE LOOKING FOR ?", vbCritical + vbYesNo, "CUSTOMER INVOICE SEARCH") = vbYes Then
          .Select
          
          Exit Sub
        End If
      End With
    End If
  Next myCell
  MsgBox "THERE ARE NO BLANK INVOICE CELLS" & vbNewLine & vbNewLine & "SO THE SEARCH IS NOW COMPLETE", vbInformation, "BLANK CELL MESSAGEE"
  Range("A6").Select
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try:
VBA Code:
For Each myCell In Intersect(Range("N6", Range("N" & Rows.Count).End(xlUp)), myRange)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top