+ Reply to Thread
Results 1 to 5 of 5

Passing Variables

  1. #1
    Registered User
    Join Date
    02-24-2011
    Location
    Somewhere, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    20

    Passing Variables

    This has always been one of my weakest areas. I am simply trying to put a "universal" sub that declares the variables and then passes them to the sub(s) needing them. I am doing this so that these variables are at the top of the code page so that others can see them easily and change them as needed. here is the code I am using:

    Please Login or Register  to view this content.
    When I run EmailOpeningReport I get
    Argument not optional

    ANY help appreciated.
    Hope everyone had a good weekend

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Passing Variables

    Change to:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    02-24-2011
    Location
    Somewhere, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Passing Variables

    so simple----I ALMOST feel dumb!!!

    Thank you!!!
    Works great!!!

  4. #4
    Registered User
    Join Date
    02-24-2011
    Location
    Somewhere, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Passing Variables

    I am still having an issue with:

    .To = Staff

    the email TO field comes up blank??

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Passing Variables

    From the code snippet you've posted, .to is not qualified...

    How about posting your full code? Kind of hard to guess what else you're doing, there

+ 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. Passing Variables to Sub
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2010, 01:28 AM
  2. Passing variables
    By Zrx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-04-2009, 06:45 AM
  3. Passing Variables
    By Jeff in forum Excel General
    Replies: 1
    Last Post: 11-04-2005, 02:50 PM
  4. [SOLVED] Passing variables from one sub to another
    By Yasha Avshalumov in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-19-2005, 12:05 PM

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