I am challenged with my Sheet GJEntry does not exist error message. It surely exists in the workbook. It is Sheet1 in properties. It is not hidden. I am trying to enter code in Cell BD2 of GJEntry ws for an HLookup in HLook sheet range A1:Z2, with column 2 data. The reference cell is BB on the GJEntry Sheet. I have spent hours trying everything I can. Any insight?
I’ve checkded the properties of the GJEntry Sheet. I’ve tried to rearrange the order of the sheets I’ve introduced. I’ve tried recording the Macro by keystrokes, but learned vba will work better. Currently I am using the direct method. The formula is not appearing in Cell BD2. It is not working. Here is the code at the end of my Sub: ‘ Set reference to GJEntry sheet
Set wsSheet1 = ThisWorkbook.Sheets(“Sheet1”)
' Check if GJEntry sheet exists
If Not wsSheet1 Is Nothing Then
' Define the range where the formula will be applied
Set formulaRange = wsSheet1.Range("BD2:BD199")
' Define the HLookup formula
hlookupFormula = "=HLOOKUP(BB2, HLook!$A$1:$Z2, 2, FALSE)"
' Apply the formula to the range
formulaRange.Formula = hlookupFormula
Else
MsgBox "Sheet1 sheet not found."
End If
Debra A Lynch is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.