Link to home
Start Free TrialLog in
Avatar of 78smithb
78smithb

asked on

VB Script in Excel

I am working on a project in Excel that I have to take an order status report and be able to take the raw data in and be able to let the salesperson be able to filter out their own name and what their status is. I have the filtering part for the status taken care of. The only problem that I am running across is being able to populate a column from the header to the footer of that section. They are broken down from a status 1-12 and there are 4 different types. Below is an example of what I am trying to accomplish at this point. The "Type" column is what I need to populate

Order #         Client                     Sales Rep                   Type
Status 1 - Entering Order
1234              Brad Smith             Robert B.
1234              Randy Drake           Robert B.
1234              Jessi Abbott            Joyce H.
1234              Jason Leidig            Kristen C.
Total Status 1: 4

This is what I need it to do when the Macro is ran

Order #         Client                     Sales Rep                   Type
Status 1 - Entering Order
1234              Brad Smith             Robert B.                     1O
1234              Randy Drake           Robert B.                     1O
1234              Jessi Abbott            Joyce H.                      1O
1234              Jason Leidig            Kristen C.                    1O
Total Status 1: 4

And so on for the rest of the statuses
Avatar of byundt
byundt
Flag of United States of America image

You will need to describe how one knows the Type and Status. Most likely, some type of VLOOKUP formula can be used, looking up the information on the raw data sheet.

If the Order number is unique, then you could use a formula like:
=VLOOKUP(A1,'Raw data'!$A$1:$F$500,4,False)
This formula takes the order number (from cell A1) and uses it to look up in a data table in Raw Data worksheet. Column A of Raw data contains the order numbers, and column D contains the Type (the third parameter 4 specifies the fourth column in the data table). The False means the data hasn't been sorted, and an exact match is required for order number. This formula could be pasted on your worksheet using a VBA macro.
modulo,
78smithb didn't respond to my post--so I object to a delete and refund.

I don't mind a PAQ and refund--but 78smithb should post the solution that was used to solve the problem.
Brad
Avatar of 78smithb
78smithb

ASKER

To be honest, the only solution I can give was that the project was taken over by someone else who wrote a VB script that was way over my head. He came in and wrote this the Wednesday after I posted my question, so I was kinda out of the picture on this and did not need to pursue it any longer. To be even more honest, I completely forgot to try to close this question after I was out of the picture on this. I really didn't have a chance to get into byundt's response to try to see if I could come to a solution. Again, this was taken over by a co-worker who wrote a macros. I looked at it, and he went a complety different route that was WAY over my head. I think I started in over my head to begin with. Not being a programer,  byundt's response was even too deep for me. I was just somewhat of an assistant on the project and thought I would try Experts-Exchange to get some help to offer my co-worker. That was my plan with byundt's response, but I was never given the chance to do so. Again, I'm sorry, byundt, for not responding this back to you, so if you need to object to a refund, I will just need to learn the hard way. I'm new to all of this and am learning all the ropes of Experts-Exchange
That's a very reasonable explanation 78smithb.

Could you impose on the your co-worker to give you the snippet of the VB script that addressed your problem? Posting it (or even a description of the approach taken) would tie up the loose ends nicely, and either I or modulo would be glad to refund your points.
Brad
ASKER CERTIFIED SOLUTION
Avatar of 78smithb
78smithb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
78smithb,
Thanks for playing ball with the EE "system". I've refunded your points (300) and PAQ the question.
byundt--Excel TA Page Editor
Thank You for your understanding and patience. I read your member profile. It's hard to believe I've corresponded with a man of your credentials.