+ Reply to Thread
Results 1 to 3 of 3

Reduce block of code

  1. #1
    Forum Contributor
    Join Date
    12-16-2006
    Posts
    349

    Unhappy Reduce block of code

    Please Login or Register  to view this content.
    I currently have the above code repeated approx 1000 blocks of the damn code, (done by a predecessor). Can I condense it ? The code checks in column IV2 and then use its value to filter the data in the sheet then it use IV to open a document and paste the dat into it, then I have another block of code that does the save for IV3 , IV4 , IV5 IV6, AND So on.

    The list held in IV has no duplicates at all.

    Any help I tried a few things but I just messed it all up ? the normal script writer has left and im having to pick up the pieces. and my vba knowledge is poor.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Try this on a backup copy of your data

    The macro identifies the last used row in column IV
    Starting at row 2 it loops through all the rows until it gets to the last used row in column IV. Performing the same actions as the example code you posted.
    Some commands have been condensed to 1 line codes instead of 2 lines of code.

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Contributor
    Join Date
    12-16-2006
    Posts
    349

    Cool What can I say ?

    It didnt work ? Not true, it worked fine once i removed one the Run "scripts"

    Thanks for all the help again, much appreciated

    Thanks

+ 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