This and That

Does a worksheet exist
    Dim exists
    Let exists = Evaluate("ISREF('" & <sheet name> & "'!A1)")
    
Top
Index
Get a count of unique values in a continuous column
    Dim amount As Long
    Dim lastRow As Long
    Dim r As Range

    Let lastRow = worksheet.Cells(Rows.Count, 1).End(xlUp).Row
    Set r = worksheet.Cells(<column letter> & "2:" & <column letter> & <lastRow>)
    Let amount = "=SUMPRODUCT(1/COUNTIF(r, r))"
    
Top
Index
Fixed header row
    worksheet.Rows("2:2").Select
    ActiveWindow.FreezePanes = True
    
Top
Index
n4jvp.com