+ Reply to Thread
Results 1 to 3 of 3

Handling Multiple Calculations and Referring to a New Range, but All Inside of VBA

  1. #1
    Registered User
    Join Date
    08-17-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    11

    Handling Multiple Calculations and Referring to a New Range, but All Inside of VBA

    Hi All,

    Dumb question for the master programmers here. Suppose I have a range of 100 numbers (or whatever number, could vary) that I want to perform some calculations on. The original range lives in the worksheet. I then want to create another range that is the result of these calculations, but I want the new range to "live" in the VBA, and not appear in the worksheet. How do I refer to the new range and "handle" it within VBA?

    For instance, suppose the original range is 100 numbers. Now let's say I wanted to create a new range as a result of squaring the original range, and then I wanted to find the slope between the worksheet range and this new VBA range using Application.WorksheetFunction.SLOPE (this could be anything, I'm just using a simple example). I'm completely lost as to how to deal with calculating and storing the new range, then referring to it, all within the code.

    Thanks so much for your help,

    LBF

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Handling Multiple Calculations and Referring to a New Range, but All Inside of VBA

    Perhaps something like this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    08-17-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    11

    Talking Re: Handling Multiple Calculations and Referring to a New Range, but All Inside of VBA

    Norie,

    I only had 15 minutes to play around with what you gave me, but I have to say, this little snippet of code is a lifesaver and I wanted to post back ASAP and tell you so (I need to research this "Evaluate" technique! Awesome.). I'm going to modify this tomorrow; basically I need to build a function within a larger collection of code but this is a critical building block for me.

    I hope you don't mind if I reply back again tomorrow -- I may have some other questions (for instance, how could you end up manipulating "arry" to something more complicated, such as having it be a cumulative total or something), but I can't test it further tonight before bothering you again.

    Again, many, many thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple Range variables inside an only Range array
    By AstroZelda in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-07-2015, 11:43 AM
  2. Error handling inside error handling
    By grantastley in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-06-2015, 03:43 AM
  3. [SOLVED] How to restrict pop of message box inside multiple times when it is inside a for loop?
    By timmu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2014, 06:00 AM
  4. [SOLVED] calculations inside userform
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 12-26-2012, 04:55 PM
  5. Replies: 1
    Last Post: 10-02-2012, 04:27 PM

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