+ Reply to Thread
Results 1 to 40 of 40

Improving a production workbook through vba to find and index operator information.

  1. #1
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21

    Improving a production workbook through vba to find and index operator information.

    I am currently trying to automate one of the reports we generate at the production facility I work at. Currently we hand type from spreadsheet document to another. What I would like to do is automate the function from within the original document.

    *** I have to be vague as the information I am working with is proprietary ***

    On the original document there are operator names in Cells B4, B7, B10, B13, B16, B19, B22, B25, B28, B31, B34, B37

    After a production shift there are certain numbers we use to evaluate our operators. These numbers are located in the corresponding cells in Rows Q, R, and S.

    What I would like to do is set up VBA to find report each instance of operator names with the corresponding cells from Q, R, and S. I would also like to include the date from the report if possible, which is in C1. The workbook is in set up in quarters, so there are a lot of sheets (1 for each day).

    B4 = Operator Name Q4 = "a value" R4 = "a value" S4 = "a value"



    Any help or ideas would be greatly apreciated. I can't use Vlookup due to the way the original document is structured.

    Thanks,
    PRD
    Last edited by PRD6; 04-20-2016 at 10:06 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: VBA Help

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: VBA Help

    Please excuse me zbor, not so much an answer as direction.

    Being realistic, you are asking for help but you have nothing and have shared little, not even a skeleton layout of the workbook and worksheets. So, what you are saying is, please design and build an application, sight unseen, test it, and deliver it. At which point I would expect there to be a "thanks very much, pretty good start, but ... can you just make it do this, this, and this ...".

    I suggest that you consider using the Commercial Services sub-forum or think about employing an Excel / VBA Consultant.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: VBA Help

    It's OK TMS, you can point user in a proper direction.

  5. #5
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    TMS,

    I apologize for not stripping down one of our production reports so that i could post it on here for everyone to view. As far as a structure i did in fact give that. In B4 is an operators name... in Q4 is how long the equipment ran... in R4 is how well the line produced... in R4 is the quality value of the product. I was trying to give enough to get a picture of the sheet without posting one. I figured refering to cells and giving them names would sufficient. Obviously I was wrong.

    I cannot post a copy of our sheet... sorry it is proprietary. I have been asked to make improvements.

    What i gather is that is not the place for me to ask my questions, I will go elsewhere. Thank you for the timely response.

    PRD

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Improving a production workbook through vba to find and index operator information.

    It's a good place to ask question but solution greatly depends on your input.
    And you are not willing to share input data.

    Nobody ask you to put real data.
    Just to mantain formatting important to understand a problem.

    For example, to put xxxxx instead of names and 12345 instead of price.

    Without some kind of example I doubt anyone can give you answer.

  7. #7
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by zbor View Post
    It's OK TMS, you can point user in a proper direction.
    It was hardly a point in the proper direction. It was an immediate reaction that screamed "You have nothing and want someone else to do it, go away". When what I was actually trying to accomplish was not reveal proprietary information while initiating a conversation. All well...

    PRD

  8. #8
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by zbor View Post
    It's a good place to ask question but solution greatly depends on your input.
    And you are not willing to share input data.

    Nobody ask you to put real data.
    Just to mantain formatting important to understand a problem.

    For example, to put xxxxx instead of names and 12345 instead of price.

    Without some kind of example I doubt anyone can give you answer.
    I'm not unwilling to put together an example. But I will not deal with someone assuming I havent a clue. Ive tried some things and I cannot get it to work.

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Improving a production workbook through vba to find and index operator information.

    Ok, lets not get distracted by side arguments about what was said before. I think we can help, but yes a sample workbook of current structure with dummy data and maybe a sheet showing desired output would make it much easier to help you tackle the issue.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  10. #10
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by Arkadi View Post
    Ok, lets not get distracted by side arguments about what was said before. I think we can help, but yes a sample workbook of current structure with dummy data and maybe a sheet showing desired output would make it much easier to help you tackle the issue.
    It will take me some time to strip one down enough that I can post it here, I may just make a basic spreadsheet with a rough layout of what we use. I will work on that, but it will take me some time. It will also give the opportunity to figure out how I want the end result to look when it's done.

    PRD
    Last edited by PRD6; 04-20-2016 at 10:37 AM.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    First, an apology, if I have wound you up. Second, some clarification: you are/were a first time poster and I/we don't know what your skill level is, what you have tried, or how successful (or not) your attempts have been. Third, I did not mean to insult you and I'm not quite sure how I did that ... but, if I did, sorry.

    As I said, it might be possible to prepare a test workbook and provide a solution that works specifically with that data. But it might not even come close in the live environment. And you may not be in a position to adapt it. As you can imagine, that would be a source of frustration for everyone involved.

    You have described what you think we need to know and, to be fair, it would be possible to produce a solution based on that information. On the other hand, there is a lot of detail missing. For example, how are the Source worksheets named? A quarter's worth of worksheets may mean something to you, but my interpretation could be something quite different. How is the Target workbook named? Is B37 the last cell of interest, or is that just the last cell you happened to mention. What is in the cells above, below, between and around the cells of interest? Are they empty/blank? Or do they have data in them that you don't need? Do you have merged cells? Where are they? Do any of the values depend on formulae? Where do you want the data to be copied and how do you want it presented? Is it just tagged on below earlier data? And probably lots more questions.

    A sample workbook with a typical worksheet structure, layout together and with some desensitized data would answer most, if not all, of those questions. And, if you add to that a mock up of the output, there can be no question about whether the objective has been achieved.

    So, once again, I apologise for ruffling your feathers. If you want to upload that sample workbook, I'm sure that someone will offer a solution that is at least a 99% fit.

    It will also give the opportunity to figure out how I want the end result to look when it's done.
    Don't you need to work back from that?

  12. #12
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    I may have been a little sensitive. I had worked all night... and I was very concerned with not sharing info I couldnt.

    So when I say quarters I mean that every day for each shift we fill out a worksheet. So the very lean example I have is just one day and a few names and numbers.

    I would like the last page to spool the date frome each sheet, that is the only unique identifier. Then add the name of each operator with the 3 values from the date.

    So 01-01-16 would look like

    01-01-16 John S. 1st value 2nd value 3rd value.

    But it need to add a row for each instance there is a name in one of the cells identified in column B.

    I can make it do it with a long list = values and make it ugly, I thought VBA would be cleaner and work better in the background.

    Thanks,
    PRD
    Attached Files Attached Files

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    I take it that when you say "Line No" you are referring to the numbers in the merged cells under the Date Heading?

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

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

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    Sample output:


    A
    B
    C
    D
    E
    F
    1
    "date"
    "name"
    "line #"
    "1st value"
    "2nd value"
    "3rd value"
    2
    01/01/2016
    John S.
    2
    98.60%
    90.60%
    0.98
    3
    01/01/2016
    Jane S.
    1
    100.00%
    96.50%
    1.02
    4
    01/01/2016
    Jonathan O.
    14
    100.00%
    86.60%
    1.01
    5
    02/01/2016
    John S.
    3
    98.60%
    90.60%
    0.98
    6
    02/01/2016
    Jane S.
    2
    100.00%
    96.50%
    1.02
    7
    02/01/2016
    Jonathan O.
    15
    100.00%
    86.60%
    1.01
    8
    03/01/2016
    John S.
    4
    98.60%
    90.60%
    0.98
    9
    03/01/2016
    Jane S.
    3
    100.00%
    96.50%
    1.02
    10
    03/01/2016
    Jonathan O.
    16
    100.00%
    86.60%
    1.01
    11
    04/01/2016
    John S.
    5
    98.60%
    90.60%
    0.98
    12
    04/01/2016
    Jane S.
    4
    100.00%
    96.50%
    1.10
    13
    04/01/2016
    Jonathan O.
    17
    100.00%
    86.60%
    1.00

  16. #16
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by TMS View Post
    Sample output:


    A
    B
    C
    D
    E
    F
    1
    "date"
    "name"
    "line #"
    "1st value"
    "2nd value"
    "3rd value"
    2
    01/01/2016
    John S.
    2
    98.60%
    90.60%
    0.98
    3
    01/01/2016
    Jane S.
    1
    100.00%
    96.50%
    1.02
    4
    01/01/2016
    Jonathan O.
    14
    100.00%
    86.60%
    1.01
    5
    02/01/2016
    John S.
    3
    98.60%
    90.60%
    0.98
    6
    02/01/2016
    Jane S.
    2
    100.00%
    96.50%
    1.02
    7
    02/01/2016
    Jonathan O.
    15
    100.00%
    86.60%
    1.01
    8
    03/01/2016
    John S.
    4
    98.60%
    90.60%
    0.98
    9
    03/01/2016
    Jane S.
    3
    100.00%
    96.50%
    1.02
    10
    03/01/2016
    Jonathan O.
    16
    100.00%
    86.60%
    1.01
    11
    04/01/2016
    John S.
    5
    98.60%
    90.60%
    0.98
    12
    04/01/2016
    Jane S.
    4
    100.00%
    96.50%
    1.10
    13
    04/01/2016
    Jonathan O.
    17
    100.00%
    86.60%
    1.00
    Oh my gosh! Thats exactly what I was thinking. When I refer to Line number that is in reference to the actual production line.

    So I opened it up and I'll have to make a few adjustments. The VBA does what it should and I actually put a button and put the code to it. So I could run it when I wanted. The only thing I think I need to really change is clear previous results before running the code, otherwise I end up with duplicate values.

    PRD
    Last edited by PRD6; 04-21-2016 at 08:04 PM.

  17. #17
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    I wish I was better at coding. I am decent with writing formulas, but when it comes to Visual Basic I need some work. I think it's time for a VBA for dummies book.

    I will load this in to a sample workbook when I am work to make sure it works like I think it needs too.

    Thank you so much for the help TMS!
    PRD
    Last edited by PRD6; 04-21-2016 at 08:05 PM.

  18. #18
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    You're welcome. We good now?

    Sometimes the line someone is assigned to breaks down and we move the operator to another line, would this pick up on that and add a separate instance for that?
    The code isn't that sophisticated. All it does is loop down column B taking every third entry from row 4 until it runs out of data. Whatever is in those rows, and only those rows, gets copied ... 'cos that is what you said way back. In your sample file, there are only three entries, but it would cope with more.

    Also note that I replicated worksheets and loop through them too. That may not be what you want but easier to take it out than back fit it.

  19. #19
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21

    Re: Improving a production workbook through vba to find and index operator information.

    Yes... We're good now. Like I said I was very concerned with what data I put on the internet when I first posted.

    The code doesn't look all that tough, but I kept losing the battle trying to retrieve the data and report a separate instance for each line with data. Either way I'd like to be better at coding, it really makes automating workbooks easy.

    Thank you for the help, I'll play with the replication and the clearing of the old data first.

  20. #20
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by TMS View Post
    You're welcome. We good now?



    The code isn't that sophisticated. All it does is loop down column B taking every third entry from row 4 until it runs out of data. Whatever is in those rows, and only those rows, gets copied ... 'cos that is what you said way back. In your sample file, there are only three entries, but it would cope with more.

    Also note that I replicated worksheets and loop through them too. That may not be what you want but easier to take it out than back fit it.
    Silly question... Since i inherited this workbook and project i was unaware there was hidden information. How do I stop the array at row 39?

    PRD

  21. #21
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    Instead of
    Please Login or Register  to view this content.
    use
    Please Login or Register  to view this content.

  22. #22
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by TMS View Post
    Instead of
    Please Login or Register  to view this content.
    use
    Please Login or Register  to view this content.
    Oh my gosh... it was right in front of me. Ive messed with everything but that. I had the offset all messed up for a minute there.

  23. #23
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by PRD6 View Post
    Oh my gosh... it was right in front of me. Ive messed with everything but that. I had the offset all messed up for a minute there.
    I found what is breaking most of this. Occasionally there is an instance where a row has been inserted since a 3rd peodunt was run. I may have to adjust the structure of the worksheet for this to operate properly. Just make every instance capable of 3 products, then the offset is 4 instead of 3.

    Like I stated, I inherited this and now I am trying to remove the redundant reporting that we do.

  24. #24
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    I may have to adjust the structure of the worksheet for this to operate properly.
    Don't try to change the structure. A) it will be hard work, B) you are sure to miss some, and C) the users are bound to screw it up for you. That's what happens. The code needs to cope with what it will find, not what you've tried to make it find. I will look at it later.

  25. #25
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21

    Re: Improving a production workbook through vba to find and index operator information.

    So what I've done is stripped one of these reports to the bare minimum. Removed anything important that I cannot share, and all the unnecessary ancillary data that is not needed. The structure is there and I've added some notes on the spreadsheet itself. I'll be honest, I could not figure out how to do this with VBA so I resorted to writing vlookup formulas. What I ended up with was a mess and only a slight time saver. The code you shared before worked... until I tried it on some copies of archived reports. That's when it hit me that occasionally a production line will run 3 products instead of 2, that messes up the offset for loop. Also it is entirely possible that two operators will share a production line, in which case we give them both credit for the numbers.

    When this worksheet was written/created this was never a thought, that's why I mentioned the structure itself. The layout doesn't boad well to extracting the info, at least in my opinion. Maybe you can see something I can't, and I'll learn something along the way.

    Thanks again,
    PRD
    Attached Files Attached Files

  26. #26
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    The worksheet makes the classic mistake of mixing aesthetic presentation with data capture, making subsequent analysis and reporting difficult.

    However, the big issue is not the gap between entries, or the additional entries where a second person works on the line, it is the merged cells containing the line number and the single entry of values for the line. It's easy enough to adjust the loop to pick up all the names, however, the line number and the values will be blank for second and subsequent entries.

    That gives me an idea for "post processing" the extracted data. The question then is, how do you split the values? Obviously, you can just repeat the line number, but do you double or treble count the values? Or is there some clever calculation?

  27. #27
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    As far as splitting the lines goes both operators would get whatever the production line did. No clever math, just two operstors sharing the wealth of the run.

    You should see this thing before i stripped it down. A ton of calculation going on. And then we do a sheet for each workday/shift per quarter. So by the time we're ready to switch quarters it takes 2 minutes to process the whole workbook. So I guess if the code read so that anyone in the operator column recieved credit for what the line did it would work.

    This is why I wish I knew more, in fact my book will arrive this week.

    At least now you can see how I got stumped. This report was made in a way to post on a board, not capture data. Now that it is aesthetically pleasing I should probably keep it that way.

    PRD

  28. #28
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    OK, try this:

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

  29. #29
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    Sorry; forgot to reply about the book. If you've ordered anything by John Walkenbach, you won't go far wrong.

  30. #30
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by TMS View Post
    Sorry; forgot to reply about the book. If you've ordered anything by John Walkenbach, you won't go far wrong.
    Yes, out of all the choices for books I chose one written by Mr. Walkenbach.

    Thanks for looking at that again. I'll give it a look when I am at work tonight.

    PRD

  31. #31
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by TMS View Post
    OK, try this:

    Please Login or Register  to view this content.
    Quick update. I got a chance to work with this the other night. When i plugged all the info in and added the VBA to the existing workbook i had an error in the code.

    The error occurs in:

    format column A as *Text* to take Date (initially)
    shOS.Range("A" & lNR).Resize(j, 1).NumberFormat = "@"

    I didnt get a chance to really dig in to it. Everything works on the few pages of examples, but it will not work in the existing workbook. I will ve able to look at some more in a day or two when i get back to work.

    PRD

  32. #32
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21

    Re: Improving a production workbook through vba to find and index operator information.

    Something about this line is breaking this code.

    shOS.Range("A" & 1NR) .Resize (j, 1) .NumberFormat = "@"

    Any idea what? I've tried checking the dates across the workbook, the formatting across the workbook. I'm lost at this point.

    Perry

  33. #33
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    What does "breaking the code" mean? What error do you get? What sheet is being processed? What is the value of lNR? What is the value of j?

    Hover the cursor over sh.Name. Is that sheet the same layout as the others? Chances are it's not lNR as that's the next row to post data on the Summary sheet ... but useful to check. Most probably j is zero ( 0 ) and that could happen if you have gone through the loop and not found any valid entries.

    That line of code is just establishing the formatting before it drops values in further down.

  34. #34
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by TMS View Post
    What does "breaking the code" mean? What error do you get? What sheet is being processed? What is the value of lNR? What is the value of j?

    Hover the cursor over sh.Name. Is that sheet the same layout as the others? Chances are it's not lNR as that's the next row to post data on the Summary sheet ... but useful to check. Most probably j is zero ( 0 ) and that could happen if you have gone through the loop and not found any valid entries.

    That line of code is just establishing the formatting before it drops values in further down.
    Sorry, when I say "breaks the code" it goes back to a coworker and I that always messed with odd programming stuffs. Just our glib for the error message and the yellow highlighted section.

    There is something about about having all this data together. It all works until i put the code into the workbook. Sample worksheets that I put together work. I'll keep looking. I work again tonight.

    Thanks,
    PRD

  35. #35
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    As I said, check which sheet is being processed, and the values of the variables. I suspect there may be hidden sheets, or sheets that are laid out differently. Hence, you may get j=0. You could put a check in for that in an If block. Or just use On Error Resume Next.

    But you need to work out what's causing it before trying to handle it.

  36. #36
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by TMS View Post
    As I said, check which sheet is being processed, and the values of the variables. I suspect there may be hidden sheets, or sheets that are laid out differently. Hence, you may get j=0. You could put a check in for that in an If block. Or just use On Error Resume Next.

    But you need to work out what's causing it before trying to handle it.
    There is so much hidden in these workbooks... years of copying and pasting, hiding and modifying. Im hoping to get permission to rewrite these production reports. For the very reason of extracting the data we use to evaluate. I can make it report out pretty, but the data needs to be arranged properly.

    PRD

  37. #37
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    Unless you can share with me, I guess I'm done here. I can second guess what the problem might be, but I can't diagnose it without the actual workbook. Goes way back to when we started really. We've moved on a long way but made up samples don't quite cut it.

  38. #38
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21

    Re: Improving a production workbook through vba to find and index operator information.

    I agree, I can't share the info I have... rules rules rules. I really appreciate your assistance on this, if I can figure out a way to share what I have I will. But I think I'm stuck with what I have.

    PRD

  39. #39
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Improving a production workbook through vba to find and index operator information.

    I'm away for another week. When I get home, I'll try and add some bullet proofing and see if that helps.

  40. #40
    Registered User
    Join Date
    10-28-2014
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    21

    Re: Improving a production workbook through vba to find and index operator information.

    Old news I know but just in case you were curious...

    Every sheet was creating an error by having blank cells where it was looking for info. On top of that the way the sheets are structured for the math to work on the bottom you have to clear out the rows that aren't being used, something I will fix. So blank spaces basically created all this havoc.

    Thank you again for all your help and now I'll get to work making these sheets work correctly.

    Thanks,
    PRD

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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