+ Reply to Thread
Results 1 to 3 of 3

How to pass dictionary from function into main sub?

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    How to pass dictionary from function into main sub?

    Hello,

    my main sub is looking like that:

    Please Login or Register  to view this content.
    In bold code there is reference to function:

    Please Login or Register  to view this content.
    So after different countings I have dictionary Dict_People and i want to pass it into my main sub.

    Now function WorkBooks_Looping will be empty.

    How can i do this?

    Please help,
    Best Wishes,
    Jacek Antek

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: How to pass dictionary from function into main sub?

    Hi,

    You need to use Set with an object assignment
    Please Login or Register  to view this content.
    It appears you want to populate dictionar with the result, so
    Please Login or Register  to view this content.
    and the function is
    Please Login or Register  to view this content.
    It is not (yet) clear what you intend to do with dictionar inside the loop.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: How to pass dictionary from function into main sub?

    Thank you xlnitwit.

    This is working.

    In function I am assigning dictionary to dictionary and sometimes if Key exists I am changing specific value within dictionary.

    Best Wishes,
    Jacek Antek

+ 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. Syntax/method to pass an AutoFilter criteria to a Function and use the value in function
    By excelnoobee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2016, 02:09 PM
  2. [SOLVED] Dictionary or Scripting.Dictionary. Binding Referencing Dim-ing. Sub routines and Function
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-12-2016, 08:28 AM
  3. Storing a Dictionary into a Dictionary Object
    By pago_boss in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2015, 03:04 AM
  4. Dictionary - Using a dictionary of dictionaries to hold individual orders
    By wazimu13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2015, 08:32 PM
  5. Replies: 3
    Last Post: 06-07-2012, 07:25 PM
  6. [SOLVED] Analyze Within An Array and Pass Back Once vs. Pass at each applicable Instance
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2012, 05:25 PM
  7. Pass switch to Main procedure
    By Tod in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2005, 07: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