+ Reply to Thread
Results 1 to 4 of 4

VBA: vlookup and return cell reference

  1. #1
    Registered User
    Join Date
    11-11-2008
    Location
    UK
    Posts
    40

    VBA: vlookup and return cell reference

    hi,
    i am trying to write some code to analyse a weightlifting movement that occurs 3 times.
    In particular there is a part of the macro where the user will input the start and end time of the movement using input boxes (to only select relevant data).
    I want to then use a vlookup function to search for the start and end times in a range (1 column) in the time range and return the cell reference of these so i can select only these values and either create a graph or do more analysis.
    My code for this particular part so far looks like:


    Please Login or Register  to view this content.
    I would now like the cell references for the start and end times....any ideas as to how to do this? I thought it might be to do with the address function.
    Any help much appreciated!!!
    Last edited by VBA Noob; 11-11-2008 at 09:30 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not just use custom autofilter for times > Start Time & < End Time, use the macro recorder whilst doing so & that will ive you some code to edit.

    You don't need to write the criteria to cells
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-11-2008
    Location
    UK
    Posts
    40
    Hi Roy,

    Thanks for that. I recorded a macro and edited to the code and tried it but when i run it, it only returns one row rather than a couple of hundred rows. I have linked the criteria to the values inputted throught the input boxes. have I done something wrong?

    Please Login or Register  to view this content.
    cheers

  4. #4
    Registered User
    Join Date
    11-11-2008
    Location
    UK
    Posts
    40
    ok managed to figure it out using the ambersand symbol. thanks for you help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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