Jumat, 25 April 2014

[ExcelVBA] Re: VBA EnableCalculation Clean Up

 

I'm at an impasse having tried every machination of code that I could think of to make the UDF work, even after incorporating Tim's mods. 

 

I would greatly appreciate any guidance in debugging the below code.

 

<<<<

Function CalcOff(Condition, Optional WorksheetNameParameter As String)
If WorksheetNameParameter = "" Then
WorksheetNameParameter = ActiveSheet.Name
Else
'WorksheetNameParameter was valued, so check that it is a valid name
Dim ws As Worksheets
Dim WorksheetFound As Boolean: WorksheetFound = False
 For Each ws In Worksheets
If Worksheets(WorksheetNameParameter) = ws.Name Then
WorksheetFound = True
Exit For
End If
Next ws
If WorksheetFound = False Then
MsgBox "The worksheet name is not valid." & vbCrLf & _
"Enter a valid worksheet name or remove the parameter to use the current worksheet."
End If
End If

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar