Results 1 to 5 of 5

'Argument not optional'

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    276

    'Argument not optional'

    I know why I'm getting the error.....cos my macro begins with:

    sub macroname(HWflag as integer)
    
    if HWflag = 1 then goto 100
    I need the variable passed from another macro for reasons that don't matter but I also need to be able to run this macro from a button. I get the error when running it from a button, obviously because the HWflag variable doesnt exist at that point but does when this macro is run from another macro. I've tested running this from a button without the (HWflag as integer) and it works fine so I'm positive what the error is, I just don't know how to cure it.

    What I need to know is how to pass a variable (of 0 value) to this macro from a command button click.

    I'm sure this is a bonehead question from a noob though.
    Last edited by swoop99; 09-14-2011 at 12:04 PM.

Thread Information

Users Browsing this Thread

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

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