+ Reply to Thread
Results 1 to 6 of 6

Edit code to change variable valuie after each loop.

  1. #1
    Registered User
    Join Date
    04-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Edit code to change variable valuie after each loop.

    Hi everyone, can anyone help me edit this code to make it loop with the variable XX, Y and Z changing for each loop.

    1st loop XX=11, Y=1, Z=6
    2nd loop XX=17, Y=7, Z=3
    3rd loop XX=22, Y=9, Z=5

    Please Login or Register  to view this content.
    Thanks.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Edit code to change variable valuie after each loop.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Edit code to change variable valuie after each loop.

    Hi Patel, I tried your code, it seems to give a type mismatch error on line:-

    Please Login or Register  to view this content.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Edit code to change variable valuie after each loop.

    I think this is closer to what Patel was trying to establish:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Edit code to change variable valuie after each loop.

    Quote Originally Posted by rocksan View Post
    Hi Patel, I tried your code, it seems to give a type mismatch error on line:-

    Please Login or Register  to view this content.
    I'm sorry, not Set xx =, but xx =

  6. #6
    Registered User
    Join Date
    04-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Edit code to change variable valuie after each loop.

    Hi Jerry, I tried your code, but it results in an overflow error though.

    This is not really a problem though, I just duplicate the codes and fixed the variable so my project can be completed. Just asking find out if there is a better way to do it more efficiently.


+ 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