Results 1 to 14 of 14

Finding a range in a formula

Threaded View

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Slovenia; Kranj
    MS-Off Ver
    Office 365
    Posts
    67

    Finding a range in a formula

    Hi,

    I'm looking for a macro/line code, which will recognise a range of cells in a formula. Let's say that I have in A1 formula:

    - =SUM(B2:F17) or
    - =VLOOKUP(B1;$B$1:$D$15;3;FALSE) or
    - ={TRANSPOSE(K3:HI236)} or
    - ...

    So as you can see, I'm talking about different sizes, types, locations (in formula), ... of ranges. The only thing they have in common is ":" between cell references.

    Now I need a macro, that will look into the cell A1, read the formula in the cell and return me a range of cells in this formula. As seen in paragraph above, for first line it will return B2:F17, second $B$1:$D$15, third K3:HI236, ...

    I was thinking to use "find :", but then I don't know how to tell how far to go on the left/right to read complete cell reference. I could use ISTEXT or ISNUMBER but it will stop at the first letter/number and as you can see I can have text HI or number 234. I can't use "find (", because sometimes range isn't next to "(" or ")" ... like in VLOOKUP example.

    Maybe a macro that it will found upper-left and bottom-right cell in range and then I can put together a range ... anything that comes to your mind will help me.


    Thanks in advance, Marko
    Last edited by DiCaver; 01-10-2013 at 03:27 PM.

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