Results 1 to 4 of 4

Multiple condtion For loop, dynamic named range

Threaded View

emburl Multiple condtion For loop,... 12-04-2012, 06:38 PM
rylo Re: Multiple condtion For... 12-04-2012, 07:15 PM
AlphaFrog Re: Multiple condtion For... 12-04-2012, 07:19 PM
emburl Re: Multiple condtion For... 12-04-2012, 09:59 PM
  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    Wellington, New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    2

    Multiple condtion For loop, dynamic named range

    Hi,

    This is my first play with VBA so apologise if the question is very easy and but I've been running into errors I cant resolve for the last couple of days.
    (if someone can suggest a good debugging tutorial would also be appreciated).

    I have a spreadsheet of building data energy use (15min intervals for many days, I've attached just two days). I'm trying to extract the time ranges where use is high/low or ramping up and down.

    All I think I need is a for loop, which loops through a named range and returns the value of the adjacent time column for the first cell which exceeds a bound (in this case this is the variable "mid"), following this I want to continue looping through the range and returns the time value where the value of the range drops below the variable "mid".

    My first problem is in this implementation loop, it gives an application/object definition error, which so far I can't resolve.

    I've attached the spreadsheet with my current VBA code

    Thanks for your time
    Attached Files Attached Files
    Last edited by emburl; 12-04-2012 at 06:41 PM. Reason: The code was confusing without comments being colured

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