Excel vba function argument not optional

Posted: NoftorgoNor Date: 05.07.2017

I have written a program, using VBA in Excel , and it runs perfect. I have been reading that it is good practice to 'compile' your program, not something I have previously done.

When I click compile, I get the following error: What does this mean? Find "Total Core Rates GB", Range "C1" , xlValues, xlWhole, xlByColumns, xlNext.

excel - Optional parameter in custom function - Stack Overflow

You must give that to the function. The survey will appear here when you've completed your visit, so please do not close this window. Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.

Strange "Argument not optional" error in VBA - Stack Overflow

If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site. Downloads Visual Studio SDKs Trial software Free downloads Office resources SharePoint Server resources SQL Server Express resources Windows Server resources Programs Subscriptions Overview Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups Events Community Magazine Forums Blogs Channel 9 Documentation APIs and reference Dev centers Samples Retired content.

The content you requested has been removed. Remove From My Forums. Microsoft ISV Community Center. Visual Basic for Applications VBA. Sign in to vote.

excel vba function argument not optional

The error occurs on this line of code: Call InsertVaRSummaryFigure Which calls this function which works fine: Function InsertVaRSummaryFigure SummarySheet As String Worksheets SummarySheet. Wednesday, September 29, 9: Hi Gazza, If you write this: And if you write that: Call InsertVaRSummaryFigure you have no transfer parameter, so the compiler said: Argument not optional" You can try this: Call InsertVaRSummaryFigure "NameOfYourSheet" or both if you want a standard Sheet, or another different: This helps others who have the same problem!

Marked as answer by Gazza Wednesday, September 29, Wednesday, September 29, Thanks Dennis, slap my wrists, I should have realised that myself. Would you like to participate? Help us improve MSDN.

Compile Error: Argument not optional

Dev centers Windows Office Visual Studio Microsoft Azure More Learning resources Microsoft Virtual Academy Channel 9 MSDN Magazine. Community Forums Blogs Codeplex. Programs BizSpark for startups Microsoft Imagine for students.

inserted by FC2 system