+ Reply to Thread
Results 1 to 11 of 11

Scripting dictionary help

  1. #1
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Scripting dictionary help

    Hi

    I attach my code and also the workbook (with the code in it along with the test data under the DATA tab, tab 1 is the macro and sheet 2 is where the macro puts the results to. I have added an expected result tab to show what I need the code to do )

    The code runs for one line only- I am trying to adapt this code from another piece of work and as you can see I am a novice
    Any help would be grately appreciated !

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Scripting dictionary help

    The code runs for more than one line, in fact it loops through the range B6:B19.

    I'm not 100% sure what the code is meant to do but I thin the reason only one row is output is because the data in column F is the same for each row on the 'DATA' sheet.

    Is it definitely column F you want to look at here?
    Please Login or Register  to view this content.
    If I change the code to look at column K, see below, the results are pretty close to what you have on the results sheet.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: Scripting dictionary help

    Hi Norie - thanks alot that is exactly what I am after. But just one thing - why is it not bringing in the last row under the expected results for Jane - the very last row (row 7) - when I run the code it excludes this row ?

    Thanks
    Leanne

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Scripting dictionary help

    Again I think the code is looking at the wrong column.

    Try this, it looks at columns J and K for the dictionary.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: Scripting dictionary help

    Hi Norie

    I initially thought it was only the one row - but when I use the code on a larger volumn a lot of the data is missing ?
    I reattach a larger sample and have the updated code saved in. I have also updated the expected results to help.

    Basically for those under the task responsibility who have task "Payroll Final Preparation" then I want that processor, the client name and due date taken from column k in the Data sheet and put in column c in sheet 2.

    Same for task description "Payroll Final Review and Delivery" - I want the processor, the client name and due date from col k in the Data sheet and put in column D in sheet 2.

    Thanks
    Leanne
    Attached Files Attached Files

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Scripting dictionary help

    The code you modified was looking at the wrong columns, Try this:-
    Results sheet2
    Please Login or Register  to view this content.
    Regards Mick

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Scripting dictionary help

    I think you might need to include Client in the dictionary.

  8. #8
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: Scripting dictionary help

    Hi Mick

    You can see this is your work from previous that I have tried to adapt to similar piece of work. When I run your code above it gives me a run time error 9.

    Thanks
    Leanne

  9. #9
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Scripting dictionary help

    You seem to have 2 different files, my code was working on the smaller one (19 rows of data), My code was working on that. I imagine you want it to work on the other file, with 49 rows of data, I'll have a look !!!!!

  10. #10
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Scripting dictionary help

    Try this on the bigger file.!!
    Please Login or Register  to view this content.
    Regards Mick

  11. #11
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: Scripting dictionary help

    Hi Mick

    Yes the smaller file works but I have also found this in past. Seems to captures all of the errors at the one time with a larger volume of data rather than me to continue to pester people over and over again.

    Thanks for your help
    Leanne

+ 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. need help with scripting dictionary
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 10-04-2014, 04:33 PM
  2. [SOLVED] Using Dictionary in VBA scripting
    By vnzerem in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-04-2014, 02:54 PM
  3. Scripting Dictionary
    By Tendla in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2013, 05:41 AM
  4. [SOLVED] Scripting Dictionary
    By thisisgerald in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-18-2012, 01:30 PM
  5. [SOLVED] Scripting Dictionary help
    By williams485 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-13-2012, 08:22 AM

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