+ Reply to Thread
Results 1 to 23 of 23

need help with scripting dictionary

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

    need help with scripting dictionary

    Hi I am fairly new to scripting dictionary and my attempt is below. Can anyone tell me why only 3 rows of data is being displayed and not running for the entire "DATA" sheet ?

    From this to this layout example.xlsx
    leanne.xlsx
    Test data sheet for report.xls

    Please Login or Register  to view this content.
    Also does anyone know how to show the results a little differently that in cells A:E


    Instead of this


    Client Name Task Description Processor Due date
    Any client 2 Client data received for payroll processing Philip McCrudden 03/10/2014
    Any client 2 Draft payroll results submitted to the client Philip McCrudden 03/10/2014
    Any client 2 FPS and EPS submitted to HMRC Philip McCrudden 03/10/2014




    I need this

    Client Name Processor Client data received for payroll processing Draft payroll results submitted to the client FPS and EPS submitted to HMRC
    Any client 2 Philip McCrudden 03/10/2014 03/10/2014 03/10/2014
    Last edited by Leith Ross; 09-28-2014 at 01:51 PM. Reason: Rearranged attachments

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello leanne2011,

    Would there ever be an occasion where a client would have more than one person assigned as the processor?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

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

    Re: need help with scripting dictionary

    Hi

    Thanks for coming back to me - no only ever the one processor/person to the one client.

    Kind regards
    Leanne

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello leanne2011,

    The macro below has been added to the attached workbook. A new sheet named "Report" was added also. Have a look and let me know what you think.

    You can run the macro using ALT+F8 keys and clicking on CreateReport.

    Create Report Macro
    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: need help with scripting dictionary

    Test data sheet for report ver 2.xls

    Thanks for taking the time to look at this but not quite there. I only need 3 tasks "Client data received for payroll processing, Draft
    results submitted to the client,Client approved PwC payroll results"

    Where you have Task/Due Date can these not be replaced by the task descriptions and only have one row of data displaying the due dates under the respective columns and no blank cells etc ? I have added in another sheet called "Expected layout needed" based on one client for example called "Anyone place ltd" to give you a better idea as to what I am trying to achieve ?

    Many thanks once again and look forward to your response
    Leanne

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello Leanne,

    Thanks for the feedback and the updated example. I will work on changing the code to match the updated requirements.

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

    Re: need help with scripting dictionary

    Leith - thank you so much for your help and wanting to help me out !!

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello Leanne,

    This workbook creates a report with a maximum of three tasks and dates. Each line starts with "Client Processor" and a blank line is placed between each entry. This was just a guess on my part.

    Have a look and let me know if I am closer to what you want.

    Create Report Macro (revised)
    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: need help with scripting dictionary

    Hi Leith

    Almost - I need specifically "Client data received for payroll processing" in cell C1 and in D1 "Draft payroll results submitted to the client" and in E1 "FPS and EPS submitted to HMRC - no other tasks.

    Also - these descriptions only need to be in row 1 - they do not heed repeating. All I want to see in row 2 onwards is the due dates for each task in each column in row 1 - so there will only be one row of data.

    It is incredibly hard when its someone elses data but I really appreciate your efforts !
    Please see attached the expected layout with a few more lines as I don't think I made it clear before

    test script.xls

    Thanks
    Leanne
    Last edited by leanne2011; 09-29-2014 at 03:06 PM. Reason: referencing of columns not right

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hel;lo Leanne,

    At this point, I am more confused than before. Here is sample of the data for "Any Client 1".

    There are 3 processor names for this account: Sebastian, Ann, and Cathy. I had asked if there would ever be such a case and you said no.

    How did you single out Sebastian and the following dates 6-Oct-2014, 9-Octt-2014 from the data? I don''t see those dates for him. The only date is 17-Oct-2014

    The accuracy of my answers depend on the accuracy of your information. Don't be afraid your descriptions and examples will be too wordy or long. I'd rather have too much information than not enough.

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

    Re: need help with scripting dictionary

    test script.xls
    Hi Leith


    In anonymising the data I have very likely incorrectly named some clients. Only ever will one client have one processor - there will never be more than one. Yes the data for Sebastian is misleading so apologies and that's my mistake. Take the data for Fiona McIntosh - filter the data tab for Anyone place ltd. There are 4 tasks and due dates for each task of which I just need the 3 (exclude task Client approved PwC payroll results)

    I just need the 3 task descriptions noted in my earlier response to you and the resultant due dates for each task under the column headers but in fixed columns. You are almost there with the data - I just want one row of data per client and processor showing the due dates for each of the 3 tasks. In yours the fields are shown horizontally but in 3 lines - I need the dates to one line with the task descriptions only shown once on row once and never again. So in Column A1 will be "Client" B1 will be processor and in C1 "Client data received for payroll processing" and in D1 "Draft payroll results submitted to the client" and in E1 "FPS and EPS submitted to HMRC. From row two onwards each client and processor will reflect only due dates under C2,D2,E2 -and repeated until all clients have been listed in this report

    does that make any more sense

    I attach in the script report again - this time take a look at sheet 1. There are lots of n/a's and its to do with the v lookups go wrong and very likely the naming has gone wrong when I have tried to change the client names. The precise layout is sheet 1 - I hope this helps
    Leanne
    Last edited by leanne2011; 09-29-2014 at 03:49 PM. Reason: need to add attachment to help understanding

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello Leanne,

    Okay, I think we have it. I revised the macro to place the due date under the proper heading it was found under. Everything is in a single row with a permanent header in row 1.

    Try this out and let me know if there are anymore changes needed.

    Create Report Macro (rev 4)
    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello Leanne,

    You change easily change which sheet the output (Report) goes to. Enter the worksheet's name in the macro marked in blue font. In this example, it has been changed to "Sheet1".
    Please Login or Register  to view this content.

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

    Re: need help with scripting dictionary

    Whohooo perfect !!!! thank u very much from bottom of heart. I can work with this to tailor the code.

    There is one final part if you can help - if not u have been fantastic so no worries. But After processor and before client data received I need to add one further column called completed due date. I need the due dates (blank) if none as per the original data report but specifically for this one task only in this column = Fps and eps submitted to HMRC. How easy is it to add in?

    Leith if you where in Belfast I would buy you a drink - sincere thanks for your time on this.
    Leanne

  15. #15
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello Leanne,

    Can you show me what this layou would look like? Just a few lines is all I need.

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

    Re: need help with scripting dictionary

    Ok layout as per attached sheet - instead of pulling in the due date from column n (from the data sheet)for the tasks in the macro - as well as this and for this particular column called completed date I need the due date from column Q "marked as complete date" for
    only 1 task specifically = fps and eps submitted to HMRC

    test script 2.xls

    thanks leanne

  17. #17
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello Leanne,

    This should do it. The "Completed Date" column has been added to the macro. Have a look and let me know what you think.

    Create Report Macro (rev 5)
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Leith Ross; 09-29-2014 at 08:21 PM. Reason: Fixed bug - Program did not save correctly.

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

    Re: need help with scripting dictionary

    Lol I bet I am doing your head in, the completed date in the report is for all tasks. It need only be completed or populated with a date for 1 specific task being "FPS and EPS submitted to HMRC"

    Kind regards
    Leanne

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

    Re: need help with scripting dictionary

    You have asked me about having just one processor to one job. There is one task that we have a different person doing (BACS) for a client but is not to be listed as the processor of that job - the processor with the task description "Client data received for payroll processing". I can see by not providing you with this correct information the incorrect processor is being picked up.

    Take client "Total" for an example. The due dates should appear under processor Kara Woodside but infact the code is placing both Ann Taggart and Kara Woodside as the processor of the same client. I don't mind if the "BACS" under column Stage is deleted prior to the code - so there is no option of picking this up ? would that be a valid option

    Thanks
    Leanne

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

    Re: need help with scripting dictionary

    I can delete the part of the report which contains a task by another person - so don't worry about this bit. Take a look at the condensed report to show one client which is processed several time in the month. The macro code is picking one row of data when there should be all 4 rows reported - take a look at the report showing the macro and what I am expecting. Leith I am sorry to be tormenting you but we are so close to the expected outcome

    Thanks very much
    Leanne

  21. #21
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: need help with scripting dictionary

    Hello Leanne,

    I changed the macro to ladd the completed only to entries with a due date in the "FPS and EPS submitted to HMRC" column.

    Please review this change and let me know if it is correct.

    Create a list of all other changes that need to be made and verify this list with your co-workers for completeness and accuracy before you post back. This will reduce the number of revisions to the project.

    Create Report Macro (rev 5a)'
    Please Login or Register  to view this content.

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

    Re: need help with scripting dictionary

    Leith - Thanks for your assistance and yes its getting frustrating u having to do all these adjustments. I thought we had it until I compared it to a previous report for correctness. The only other outstanding revision if you are able to still help is to do with the rows for each client. Some clients are weekly and therefore the due date needs to be reported for each week.

    Take client "Total" for an example. The due dates should appear under processor Kara Woodside but infact the code is placing both Ann Taggart and Kara Woodside as the processor of the same client. It is Kara's client and Ann Taggart only steps in at the end for 1 part and never her client. I don't mind if the "BACS" under column Stage is deleted prior to the code - so there is no option of picking this up .All I can think is I can write basic code to delete the BACS stage out before running the report. My main issue is the due dates should be shown in the report x 4 for each week for client "Total" for example - at the minute it is picking just the one line up for the client.

    That's will be the final amendment. The only other question I would like to ask is how you came to understand scripting dictionaries? Is it a case of continually doing them you eventually come to understand them ?

    Thanks
    Leanne

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

    Re: need help with scripting dictionary

    Please can someone help me with this - thanks

+ 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. Scripting.Dictionary .. Error
    By ks1102 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-09-2014, 06:08 AM
  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