Find specific cell using VBA

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Find specific cell using VBA

  1. #1
    Board Regular
    Join Date
    Oct 2005
    Location
    London, UK
    Posts
    139
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    43,779
    Post Thanks / Like
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)

    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 09:01 AM.
    Use the MrExcel HTML Maker to post nicely formatted tables in your forum posts.
    Find a link in post number 31

    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

User Tag List

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