+ Reply to Thread
Results 1 to 4 of 4

VBA match, index, lookup... confused

  1. #1
    Registered User
    Join Date
    08-09-2007
    Posts
    4

    VBA match, index, lookup... confused

    Hi there,

    I'm just looking at VBA for the first time. I'm coming from a PHP, BASH and assorted other Linux languages background. Short of throwing this Excel spreadsheet into a MySQL DB and doing what I want on the server in PHP, I thought I would poke around with this VBA stuff and maybe learn something new.

    I have a rather large spreadsheet that is based on about 12 worksheets (9k+ rows) and it's been a blast learning how to tie them in to one another with Excel functions.

    I have to find a way to search row 1 (in one of those worksheets and then return all the data in that row.

    I thought I would insert an Excel 5.0 dialog. Create an input form to match the input to the worksheet then return the row info in a nicely formatted page.

    I see there is some scripting capability here, but I'm not sure where to start.

    I've done some searching over the past two days, including this forum, and some people have mentioned a match function, but I'm not sure where the resources on VBA are. I went to the VBA Excel document site at msdn.microsoft.com, but I can't drill that thing for anything.

    If anyone has an example I could work off of or a couple of URL's to documentation that would be appreciated! There doesn't seem to be a whole heap of people out there who cover this kind of stuff.

    I've got about a three days to put this together or I'll have to drop the project and go with what I know.

    (Sorry about the double post. My bad.)
    Last edited by strixy; 08-15-2007 at 04:47 PM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    How would you like to identify the sheet that has the data you want? Do you want to nominate the sheet, or some info that may be contained in the row????

    rylo

  3. #3
    Registered User
    Join Date
    08-09-2007
    Posts
    4
    I set up the format I was looking for in a second worksheet. The code I used for one of the cells is shown below.

    C4 is the cell where you enter the p/n you want to find.

    Please Login or Register  to view this content.
    The first line is in cell A6. It finds the part number in sheet1 (as entered into cell C4) and returns the row number.

    I used the second line to find the row for the p/n (as returned by the first line). Then display the items by placing the column number for whichever item I need to display as the last number in formula on the second line.

    It works well in the spreadsheet, and people are thrilled! I just thought I would learn how to do the same thing in VB for the experience. I think it would look even slicker that way.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Have a look at the attached and see if it gives you some ideas.

    Don't hesitate to come back with questions......

    rylo
    Attached Files Attached Files

+ 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