+ Reply to Thread
Results 1 to 23 of 23

VB for making the changes in report to retrieve the correct values

  1. #1
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    VB for making the changes in report to retrieve the correct values

    Dear All,

    We used to get a report from another department which is very important for our monthly production

    But there are few things that needs to be changed in that report for retrieving those values.

    If I miss any of the sub-tasks mentioned below, It is going to be big messup

    I've recorded a macro for doing the below tasks with a single click rather than doing it manually. But here problem is recording macro doesn't resolve my issue and there are few things that needs to be executed by editing this code where as I'm unaware of VB at all. So request someone to go through the below tasks & help me in the code

    Attached excel with Sheets SSR (this is the actual report which we get) & SSR_After (this is the report after changing it to retrieve the exact values)

    1. Unhide all in SSR Sheet
    2. Unmerge 5th Row and write formula =B5 in C5 and paste special this formula in the right side blank cells
    3. Lookup location of SSR to Sheet1 (=VLOOKUP(B5,Sheet1!$A:$A,1,0)) at Row 4 and delete columns where this formula returns NA Error
    3. Insert column at Column B, Lookup Models of SSR to Sheet2 at B Column (formula at B8 =VLOOKUP(A8,Sheet2!B:D,3,0) and drag down till end)
    3. Delete the rows where above formula returns NA Error
    3. Make all the values as zero (from C8 to last column for all the models) if above formula returns "r" except if Row 4 has "Secunderabad" & "Vijaywada"
    5. Insert 7th Row and write formula =B5&B6
    6. Lookup location of ssr to Sheet1 at 4th Row & Delete columns where there is #N/A
    7. Make E Column of Sheet3 as zero where there is no formula
    8. Make Range from B51 to C53 in Sheet3 as zero
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Dear All,

    Could Someone reply on this.

  3. #3
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Dear All,

    Could someone reply on this.

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    this one is far from perfect

    just give it because there are no other suggestions so far



    Kind regards
    Leo
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Thanks & Perfect Leo!!!

    One and only small change & Help required is, whereever column has BAL then I need formula to be shown =SSR Value - DESP Value

    SSR Value & DESP Value - Value where it is in SSR Column & DESP Column respectively

    ex: for Delhi, I8 (DELHI BAL VALUE) should not be static value but formula should be =F8-G8 where F8 is DELHI SSR Value & DELHI DESP VAlue

    Please do this small favor and help me.

    Regards
    Anil T

  6. #6
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    If between SSR en BAL are always 2 columns this can do


    Kind regards
    Leo
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Thanks a Ton Leo!!!!

    I want to learn VB from you & expertize my knowledge!!!

  8. #8
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    could it be last column BAL is not done ?

    if so it is solved in this


    Kind regards
    Leo
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Hi Leo,

    Thanks for your previous help. we have got another report from the concern dept and one point seems to be not executing with VB i.e., as per the above points mentioned in the above requirement, below point is making zero for all values that formula return "r" whereas I dont want to make "Secunderabad" & "Vijayawada" as zero except this I want to make all of the others as zero.

    3. Make all the values as zero (from C8 to last column for all the models) if above formula returns "r" except if Row 4 has "Secunderabad" & "Vijaywada"

  10. #10
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    Line with a change in red

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Dear Leo,

    With the above code, Everything should be zero except secunderabad & Vijayawada. But these are not becoming zero.

    Please do the needful.

  12. #12
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    3. Make all the values as zero (from C8 to last column for all the models) if above formula returns "r" except if Row 4 has "Secunderabad" & "Vijaywada"
    changed to

    Make all the values as zero (from C8 to last column for all the models) except if Row 4 has "Secunderabad" & "Vijaywada"

    Kind regards
    Leo
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    | and ?

  14. #14
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Dear Leo,

    As per your attached file, there is no code for SSR Sheet in order to make the above said changes

    Can you please check and provide the revised file.

  15. #15
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    see, wrong attach


    kind regards
    Leo
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Quote Originally Posted by LeoTaxi View Post
    changed to

    Make all the values as zero (from C8 to last column for all the models) except if Row 4 has "Secunderabad" & "Vijaywada"

    Kind regards
    Leo
    3. Insert column at Column B, Lookup Models of SSR to Sheet2 at B Column (formula at B8 =VLOOKUP(A8,Sheet2!B:D,3,0) and drag down till end)
    3. Delete the rows where above formula returns NA Error
    3. Make all the values as zero (from C8 to last column for all the models) if above formula returns "r" except if Row 4 has "Secunderabad" & "Vijaywada"

    As per the above 3 lines, where 2nd point is being excuted well (Delete the rows where above formula returns NA Error) where as third point I dont want to make everything as zero. I want to make C8 to till end as zero if the above formula return "r" & if 4th row not equals to Secunderabad" & "Vijayawada"

  17. #17
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    like this ?

    Kind regards
    Leo
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Quote Originally Posted by LeoTaxi View Post
    like this ?

    Kind regards
    Leo
    You are very close to my requirement, as of now we are keeping the values as is with this VB Code for Secunderabad & Vijayawada and making everything as zero. I want to be zero for the below Models only, not for the entire list

    Please go through the below list in sheet2 also where I've marked in the Sheet-2 D Column as "r"

    Model wise as per client
    CB1200MM-OPW-WOR
    CB1200MM IVY- WOR
    CB1200MM LUSTERBRN- WOR
    CB1400MM OPW-WOR
    CB1400MM IVY-WOR
    CB1400MM LUSTER BRN-WOR
    WWDECORA1200-OPW-WOR
    WWDECORA1200-IVY-WOR
    WWDECORA1200-LB-WOR
    WWHE1200-OPW-WOR
    WWHE1200-IVY WOR
    WWHE1200-L/BRN WOR
    WWHE1400-OPW-WOR
    WWHE 1400 IVY WOR
    WWHE1400-L/BRN WOR

  19. #19
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    can you tel me the list above is a other list then the list you get with the "r" in colymn B ?

  20. #20
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Quote Originally Posted by LeoTaxi View Post
    can you tel me the list above is a other list then the list you get with the "r" in colymn B ?
    Actually Leo, I didn't get you. I'm sorry if I have confused you. But can you please clarify your comment so that I can give you a clarrity

  21. #21
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    same for me Laansesu

    i dont see a difference
    maybe you show the difference in excel file


    Kind regards
    Leo

  22. #22
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Hyderabad
    MS-Off Ver
    2007
    Posts
    160

    Re: VB for making the changes in report to retrieve the correct values

    Dear Leo,

    Sheet1 has the details as per our format & SSR Sheet has the details as per client format.

    So I'm using Sheet2 as helper column/sheet to map Sheet1 & SSR.

    whereever these models marked as "a" we are serving those models in all locations & whereever models marked as "r" we are serving only 2 locations secunderabad & Vijayawada.

    Is this clarrification sounds good for you.
    Last edited by laansesu; 02-08-2016 at 03:30 AM.

  23. #23
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VB for making the changes in report to retrieve the correct values

    no dont get it
    maybe like your exemple before with a SSRsheet after
    give a new sheet after, think only then i can go on


    Kind regards
    Leo

+ 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] Report with repetitive lines. Retrieve value ONLY one time
    By DPP in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-31-2014, 12:00 PM
  2. Making a report that shows only values below a certain percentage
    By pbatt in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-13-2014, 02:05 AM
  3. formula to retrieve & report 1st 2 duplicates from a list
    By stockgoblin42 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-30-2013, 01:22 PM
  4. Web Query needs todays date at end of URL to retrieve correct data
    By the duke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2013, 01:14 PM
  5. Making sure the data is put on the correct row.
    By jsgray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2010, 01:15 PM
  6. Using WebTable to retrieve correct data
    By Bahnzo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2009, 09:52 PM
  7. How to retrieve full report from Web
    By Calculate Date range in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-20-2006, 06:40 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