Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6741073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:40:54+00:00 2026-05-26T11:40:54+00:00

I have a dictionary dictA that contains {AA,1},{AB,2},{AC,3} and an adjustment dictionary dictAdj containing

  • 0

I have a dictionary dictA that contains {AA,1},{AB,2},{AC,3} and an adjustment dictionary dictAdj containing {AB,-4}.

I pass these two into a function call it funcReconcile(ByVal Arg1 as Dictionary, ByVal Arg2 as Dictionary) as Dictionary.

The function is going to loop through the contents of dictAdj to see if they exist in dictA.

The function will then adjust dictA (for example) to show {AA,1},{AB,-2},{AC,3} in the output dictionary.

For some reason, when the function returns the dictionary, my original dictA is also effected, causing it to display {AA,1},{AB,-2},{AC,3} and not {AA,1},{AB,4},{AC,3} as it should.

I know there are issues in VBA with passing ByRef and ByVal for objects, but this is the first time really hitting my head against the wall with something like this.

Any pointers? (no pun intended)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:40:55+00:00Added an answer on May 26, 2026 at 11:40 am

    You would have to build a copy method, make a complete copy of the dictionary, and then make modifications on the copy.

    Assigning to a new variable just assigns the original reference to the new variable — which points back to the original data.

    Here’s some fragmentary code from Copy from one dictionary object into another?:

    a=dictionary1.items
    b=dictionary1.keys
    for i=0 to ubound(a)
      dictionary2.add(b(i), a(i))
    next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dictionary, lets call it myDict , in Python that contains a
I have two NSMutableArrays(initialized from plist file contents) that contains Dictionary objects. Could anyone
I have Two Dictionary DictA & DictB such as: Dictionary<int, string> DictA = new
Say I have a dictionary and then I have a list that contains the
I have a dictionary metadata that contains key-value pairs of strings, lists, dicts, and
Really two questions: If I have a dictionary (that originally came from parsing a
I have a class that contains something like this Dictionary<int, Queue<string>> dict and then
I have three array..say array1,array2,array3. All these arrays contains dictionary.Now, I want to copy
Have Dictionary <Int64, byte> that gets used a lot. I mean in a loop
In a class Week, I have created a dictionary using the .fromkey() method that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.