+ Reply to Thread
Results 1 to 4 of 4

loop for shifting one column after each calculation

  1. #1
    Registered User
    Join Date
    04-01-2013
    Location
    Malelane, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    6

    loop for shifting one column after each calculation

    Good day

    I have a dataset arranged in columns. I need to calculate the slope that exists between the data of two columns, and repeat it for subsequent columns. However, the array of y-values remain the same with each calculation, but the array of x values moves 1 column forward after each calculation.

    My sub for the first two calculations looks something like this:

    Please Login or Register  to view this content.
    How do I create a loop to automatically repeat this process till the last column? I have attached the excel worksheet if that helps...
    Sorry if this is an elementary question - I am still new in the VBA world...

    Regards
    Brand
    Attached Files Attached Files
    Last edited by arlu1201; 04-02-2013 at 03:48 AM. Reason: Use code tags in future.

  2. #2
    Registered User
    Join Date
    03-18-2013
    Location
    Stryków, Poland
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    21

    Re: loop for shifting one column after each calculation

    Use "for" loop:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-01-2013
    Location
    Malelane, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: loop for shifting one column after each calculation

    Thank you for the reply.

    However, the program still moves the y-range column for each subsequent calculation - remember that I want only the the x-range to shift for each calculation while the y range remains in the same column...

    Please can you give me some hints on how to fix this...

    Regards
    Brand

  4. #4
    Registered User
    Join Date
    03-18-2013
    Location
    Stryków, Poland
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    21

    Re: loop for shifting one column after each calculation

    Hint

    Please Login or Register  to view this content.

+ 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