+ Reply to Thread
Results 1 to 9 of 9

Finding the value at the intersection of a row and column

  1. #1
    Registered User
    Join Date
    04-30-2010
    Location
    Wales, Boyo
    MS-Off Ver
    Excel 2007
    Posts
    42

    Finding the value at the intersection of a row and column

    I have a worksheet that holds sales data in a tabular layout. With months listed across the columns and categorys listed down the rows.

    I have another worksheet (budget) that is built dynamically using vba for a date range which falls inside the column dates found in the sales data sheet.

    The budget sheet also has a number of the same categories as the row labels.

    I need to be able to pass the values of the column heading (vDate) from the budget sheet and the row label (vCategory) to a routine that will find me the value from the intersection for that date and category on the sales data sheet.

    Is there an easy way to do this in vba?

    Thanks in advance
    Last edited by TheCyrusVirus; 06-15-2010 at 11:04 AM.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Finding the value at the intersection of a row and column

    The VBA Find Method can be used to return a range object for the location of the category and date. You could then find the row/column related to these and get the value from where these intersect quite easily.

    If you need help with the code post back.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Finding the value at the intersection of a row and column

    TheCyrusVirus,

    Try:

    Index Match Match, or VLOOKUP MATCH
    Posts: 8 Lookup help
    http://www.mrexcel.com/forum/showthread.php?t=466713


    Or, post your workbook (click on the New Post button, and scroll down and see Manage Attachments).
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Finding the value at the intersection of a row and column

    Or in VBa

    Please Login or Register  to view this content.

    or in more general terms
    Please Login or Register  to view this content.
    called as
    Please Login or Register  to view this content.

    Hope this helps.

    If you need any further information, please feel free to ask further

    However

    If this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody!
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.
    Last edited by Marcol; 06-15-2010 at 09:14 AM.

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Finding the value at the intersection of a row and column

    Put together an example using formula and code, see attached.

    Dom
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-30-2010
    Location
    Wales, Boyo
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Finding the value at the intersection of a row and column

    Awesome, thanks for the replies. I will take a look at implementing this in my workbook and come back to you if i get stuck.

    Thanks again

  7. #7
    Registered User
    Join Date
    04-30-2010
    Location
    Wales, Boyo
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Finding the value at the intersection of a row and column

    Thanks to everyone, worked like a charm

  8. #8
    Registered User
    Join Date
    12-29-2012
    Location
    Toronto, canada
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Finding the value at the intersection of a row and column

    Found this old thread and was hoping to to get a little more help from Dom I tried your example and it worked flawlessly and was able to adapt it to my own application. Being a novice with zero VBA I'm patching together a speadsheet using this macro and would like to know how I can run it as numbers are entered instead of the use of a button.
    Quote Originally Posted by Domski View Post
    Put together an example using formula and code, see attached.

    Dom

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,610

    Re: Finding the value at the intersection of a row and column

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

+ 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