Matching Visible column / row contents from 2x different Tables

dcg38524

Board Regular
Joined
Dec 4, 2013
Messages
113
Hello Mr. Excel Forum members,

I need you help and advice. The code below works fine but I wanted to get away from hard coding the column / row numbers and use the Table header names instead.

Any help would be greatly appreciated.
-Don


Code:
If rNumber_of_Rows = Number_of_Rows Then

    Sheets("Review Sheet").Activate
    Range("AZ2", Cells(Rows.Count, "AZ").End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(1, 1).Select
    rCount = 0
    
        While rCount < rNumber_of_Rows
        
            ActiveCell.FormulaR1C1 = _
        "=IF(ISNA(VLOOKUP(RC21,'RAW-DATA 2017'!R[-31]C11,1,FALSE)), ""NOK"", ""OK"")"

        
                If ActiveCell.Value = "NOK" Then

                    MsgBox ("HALT There is a mismatch between Review & RAW data!"), vbOKOnly, "ERROR STOP!!!"
                
                End If

            ActiveCell.Offset(1, 0).Select
        rCount = rCount + 1
        Wend
Else

    MsgBox "ERROR Please check latest update before saving report rows in tab Review Sheet do not match"

    Sheets("Review Sheet").Select

    Range("AZ2", Cells(Rows.Count, "AZ").End(xlUp)).SpecialCells(xlCellTypeVisible).Cells(1, 1).Select
    
End If
 
Last edited:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

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