+ Reply to Thread
Results 1 to 8 of 8

Macro not displaying all the rows. Cuts some

  1. #1
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Macro not displaying all the rows. Cuts some

    Need help with this file, i did most of the code but cant figure out some bugs i am having.

    CTRL-SHIFT-F runs the macro,

    the problem i am running into is ,

    1), i have the macro looking up the legend in row 3 in the factory install tab, and having it find this legend in the T1 Verbiage file. Once found i want all of the data in the column of that legend pasted in row 12.

    I currectly have the macro pasting the legend verbiage according to the legend in row 3 correctly but it leaves out some rows. Can someone look at the code and find out why its leaving out some rows of verbiage?


    , Next i have certain requirements of where Capital E's should go, where routine maintanence should go ect. I have that at the end of the code and is correct.

    The problem here is with this part. ( starts at row 12, counds all of n which is the verbiage rows, then adds 8. So in other words this formula needs to be 8 rows after the verbiage ( which is dynamic depending on the legend )

    Cells(12 + n + 8, i + 1).Value =

    i need this value to equal a formula. It needs to Say Completed have a space and include the data that is in row 2.

    In excel this would look like ="COMPLETED"&" "&B2

    Obviously this is dynamic, meaning if i am in Column H, it would say ="COMPLETED"&" "&H2

    Once again ctrl shift f runs the macro, which shows you the results i have so far. Once again the problems include ALL the verbiage rows are not being pulled, it leaves some at the end, and also the place where it shows completed needs to be the formula i explained above.

    This might sound confusing but if anyone downloads the file and runs this macro they will clearly understand what i am doing.

    Thanks for anyone that helps, as this will save me tremendous time.

    Thanks
    Attached Files Attached Files
    Last edited by donnydorko; 02-05-2009 at 01:19 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro not displaying all the rows. Cuts some

    Hi

    Can you add another sheet to your example file that shows what the output SHOULD look like for the example data. Makes things easier for us to understand instead of trying to work it out from code that you say is not running as required.


    rylo

  3. #3
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Macro not displaying all the rows. Cuts some

    Here is what it should produce, only difference b/w the 2 are in the yellow.

    Row 11 needs to have this formula produced by the macro ( i have no clue how to do this hence why my other file produces nothing in row 11 ),

    and then the other yellow box which has the formula as shown. It's dynamic depending on how long the legend verbiage is. From my original file when i run it you will see it shows a formula but it is not pulling from row 2 like it should be, ( once again im not good with formulas ).


    Besides that the only other problem is that my macro is not pulling all the rows in the verbiage tab. Notice how the first column PV, does not pull the last row in the verbiage for PV.

    8
    SCHEDULE NEXT SERVICE APPOINTMENT

    It should produce this in the first column when i run the macro, but it stops at 8. Some reason i dont have the macro pulling all the data.

    Thanks, hope this helps.

    THanks
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro not displaying all the rows. Cuts some

    Hi

    See how this goes.

    Please Login or Register  to view this content.
    rylo

  5. #5
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Macro not displaying all the rows. Cuts some

    WOW, perfect.

    Very impressive, you did this so fast.

    Much different approach then i took. I assume its better because it works :D

    Will this macro work with other sheets, i have other tabs, after the 5-20k, for instance the next tab is 30k, 40 k ect. Legends are in the verbiage part once again, but different tab name.

    Also if i want to use T2 Verbiage tab instead of T1 Verbiage tab what would i have to change.

    Reason i am asking is sometimes the tab's change names and i want to make sure i can fix it.
    Last edited by donnydorko; 02-05-2009 at 02:16 AM.

  6. #6
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Macro not displaying all the rows. Cuts some

    Ok i tried it with a different verbiage name and it didnt work, but i changed it in teh macro and it ran fine.

    The problem now is , can i make it to where it works in any sheet? So it's not name dependent. Because otherwise i will have to make 10 of these macros , each for each different factory mileage tab.

  7. #7
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Macro not displaying all the rows. Cuts some

    probably way some way to make it use the active sheet's name right?

  8. #8
    Forum Contributor
    Join Date
    01-25-2009
    Location
    Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    177

    Re: Macro not displaying all the rows. Cuts some

    FIgured it out, just removed the line with the tab name.

+ 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