Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a cell named "devFlag" in my spreadsheet and I want to examine its
contents in VBA code. The cell contains the value "Y", but this code returns FALSE. Const cdevFlag As String = "devFlag" Const cchktot As String = "check_totals" Function checkdevFlag() As Boolean Dim rdevFlag As Range Set rdevFlag = Names.Item(cdevFlag).RefersToRange If (rdevFlag.Value = "y") Then checkdevFlag = True Else checkdevFlag = False End If End Function My intent is to use the function in other VBA code, but for testing I've tried using the function in an IF as: =IF(checkdevFlag(),"devFlag is y","not") this returns "not" and as: =checkdevFlag() this returns FALSE Can someone see what I am doing wrong? TIA, Phil |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cell references in excel vba code | Excel Discussion (Misc queries) | |||
convert relative cell references to absolute cell references via amacro? | Excel Discussion (Misc queries) | |||
How to rename references from range names to cell references | Excel Discussion (Misc queries) | |||
Relative Cell References within VBA code | Excel Discussion (Misc queries) | |||
syntax question - cell references in VB code | New Users to Excel |