Results 1 to 2 of 2

Thread: Find specific cell using VBA

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

    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
    Bryan, TX

    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.
    Add-in for posting ranges as copyable tables (bottom of the page) -Win & Mac

    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