Results 1 to 2 of 2

Find specific cell using VBA

This is a discussion on Find specific cell using VBA within the Excel Questions forums, part of the Question Forums category; I have a table in Excel which has dates across the top and categories along the left. I am creating ...

  1. #1
    Board Regular
    Join Date
    Oct 2005
    Location
    London, UK
    Posts
    139

    Default Find specific cell using VBA

    I have a table in Excel which has dates across the top and categories along the left. I am creating a form in which you can specify your category and date and enter some text in a text box and when you click ok, a macro will find the correct cell on the table (using the date and category values) and copy the text. Has anyone got any code that will do this?
    Thanks in advance

  2. #2
    MrExcel MVP Jonmo1's Avatar
    Join Date
    Oct 2006
    Location
    Bryan, TX
    Posts
    32,547

    Default Re: Find specific cell using VBA

    Someting like this..

    MyDate = DateValue("07/18/08")
    MyCat = "Category"

    x = Application.Match(MyCat,Range("A1:A1000"),0)
    y = Application.Match(Cdbl(MyDate),Range("A1:Z1"),0)

    MyResult = Cells(x,y).Value

    Hope that helps...
    Last edited by Jonmo1; Jul 18th, 2008 at 08:01 AM.
    Want better/faster responses to your questions?
    Use Excel Jeanie to post samples of your sheet.

    The more we learn, and the better we get at our trade, the easier it becomes to overlook the obvious.

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.
    Ferris Bueller A.K.A. John Hughes, 1986

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com