UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Useasref As Boolean, Office 2007    
 
   
mjschukas
post Apr 17 2012, 02:42 PM
Post #1

UtterAccess Ruler
Posts: 1,357



UseAsRef As Boolean

i see the true false values in debug mode, but where does this value come from in a function such as:

Function SheetName(rCell As Range, Optional UseAsRef As Boolean) As String

Application.Volatile

If UseAsRef = True Then

SheetName = "'" & rCell.Parent.Name & "'!"

Else

SheetName = rCell.Parent.Name

End If

End Function

???

thank you.
Go to the top of the page
 
+
ipisors
post Apr 17 2012, 03:04 PM
Post #2

UtterAccess Certified!
Posts: 6,943
From: Arizona, United States



Hello,

I am interested in trying to answer this or contribute, but I'm unclear on your question. It appears that someone wrote a function that was intended to do this in plain english:

1. provide a function with required argument rCell (to be used as Range), and optional argument UseAsRef (to be used as Boolean).
2. The function will evaluate to string expression of worksheet name if UseAsRef is False, otherwise, with an additional single quote at the beginning and exclamation point at the end.

I'm not clear on your question?
Go to the top of the page
 
+
norie
post Apr 17 2012, 03:14 PM
Post #3

UtterAccess VIP
Posts: 4,297



Not sure what you mean.

You pass the values to the function, if you don't pass the (optional) boolean value it will be the default value for Boolean which is False.

If you don't want it to be False you can specify the default value like this.
CODE
Function SheetName(rCell As Range, Optional UseAsRef As Boolen = True) As String
Go to the top of the page
 
+
mjschukas
post Apr 17 2012, 05:53 PM
Post #4

UtterAccess Ruler
Posts: 1,357



thank you...

i missed the arguments in the function...thank you...!
Go to the top of the page
 
+
norie
post Apr 17 2012, 06:25 PM
Post #5

UtterAccess VIP
Posts: 4,297



And I missed the a in Boolean.(IMG:style_emoticons/default/dazed.gif)

Why don't forums have IntelliSense?(IMG:style_emoticons/default/smile.gif)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 26th May 2013 - 12:33 AM