+ Reply to Thread
Results 1 to 3 of 3

Using a With Statement within a Public Function ('Argument not Optional' Error)

  1. #1
    Forum Contributor
    Join Date
    04-11-2017
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2010
    Posts
    110

    Using a With Statement within a Public Function ('Argument not Optional' Error)

    Hi

    I am trying to use a 'With' statement in a Public Function to refer to a sheet which I have named within VBA however I am receiving a Compile Error: Argument not Optional' message.

    Is it not possible to use With statements in Public Functions?

    Thanks in advance

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2507 Win 11
    Posts
    24,920

    Re: Using a With Statement within a Public Function ('Argument not Optional' Error)

    post your code for analysis
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    04-11-2017
    Location
    Edinburgh, Scotland
    MS-Off Ver
    2010
    Posts
    110

    Re: Using a With Statement within a Public Function ('Argument not Optional' Error)

    I managed to solve this. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Error for VBA function - "Argument Not Optional?"
    By EverGreen1231 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2017, 01:59 PM
  2. Argument not optional error
    By Pi* in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2016, 09:50 PM
  3. [SOLVED] Getting error 'argument is not optional'
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-12-2015, 10:01 PM
  4. Using a Boolean function within an If statement: Argument not optional error message
    By elfsprin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2011, 04:12 PM
  5. Please help with 'Argument Not Optional' error.
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-09-2011, 01:49 AM
  6. VBA getting argument not optional error
    By sulavsingh6 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2009, 01:06 PM
  7. Argument not optional Error 449! Need Help
    By bad_boyu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2006, 08:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1