+ Reply to Thread
Results 1 to 8 of 8

VB Code to create DICT

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to create DICT

    Hello:

    Please refer to attached file, sheet "Debit".
    Based on what is in column C, i need to get values in column D as below:

    If STREAM GEORGIA G BILL PAY 4001573008 then value in correcponsing cell in column D would be Utilities:Gas
    If FOODSERVICE VENDOR PAY 072691182550000 then value in correcponsing cell in column D would be Cost of Goods:USFoods

    etc

    Bascially i would need to create VB Dictionary i guess, not sure.
    Please help.


    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code to create DICT

    Hi Riz,

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to create DICT

    Hello xlaDept:

    This works, however is there a way i can create a table 2 columns which replicate column C and D.
    Then the code needs to lookup thru that table.
    This was i can keep on adding more payee and catagory.
    Please let me know if you have any questions.
    Thanks.

    Riz

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code to create DICT

    I put the table in "H:I" and Named it "RizTable" - let me know if that's OK

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to create DICT

    Hello xlaDept:

    Please refer to attached file.

    I think there is some misunderstanding but we are nearly there.
    Let me explain.
    At the end of each month, i will be downloading lots of business account bank statement in excel.
    So this is what i am trying to achieve.
    It will be best if i have external table in Sheet1 of lets say at C:\Temp\CatTable.xls
    Here the table will have 2 column of data, Column A wil be Payee and Column B will be the expense catagory.

    My logic is to import the table at say Column H.
    Now i will need to put Vlookup formula in column D to complete what i need.

    Please let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VB Code to create DICT

    Hi Riz,
    I'll look at it in the morning and let you know my questions then

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,338

    Re: VB Code to create DICT

    This is just a first draft. No declaring variables, no sheetnames ...

    I think there equally fast.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  8. #8
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to create DICT

    Hello bakerman:

    Thanks a lot, will try for sure....iand i know it will work.
    Riz

+ 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. [SOLVED] "Store Value in DICT and Change Color if not exist"
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2017, 06:56 AM
  2. write code to skip two tabs, create a tab, code, skip two tabs, create a tab, code, etc
    By elmasguapo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2015, 06:01 PM
  3. Script dict displaying one row instead of all applicable rows ?
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2014, 02:58 PM
  4. [SOLVED] Help me fix attached code (create Outlook email then create calendar item)
    By Rerock in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-19-2013, 08:15 PM
  5. why how does this code create a new sheet after the last line of code...
    By tconnell1965 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2013, 06:23 AM
  6. Replies: 0
    Last Post: 07-05-2006, 06:30 AM
  7. Create a newworksheet with VBA code and put VBA code in the new worksheet module
    By ceshelman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-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