+ Reply to Thread
Results 1 to 2 of 2

Finding cells based on another cell

  1. #1
    Registered User
    Join Date
    06-08-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    20

    Finding cells based on another cell

    I kind of hope this is easy and that 20 people can jump on this and say "I know the answer to that," but I also kind of hope that this will be a challenge to you guys, since I'm sure that most of you enjoy challenges.

    I think I have the steps that need to get done pretty well numbered out, and I think that there should be a way to program them, but I just have no idea how to do it.

    I have a spread sheet with 31 worksheets on it (30 baseball teams, and the 1 to simulate baseball games).

    What I'd like it to do is the following (this is just the first half, of finding the data and gathering it).

    1) If cell Macro1!A9 is empty, end macro.
    2) Locate the worksheet that has the same name as cell Macro1!A9 (in this cell, I place the team name, so if it is "SEA", it should go to the "SEA" worksheet, this way I can change it later to any team and the macro can still function)
    3) Locate the cell in that worksheet that has the same name as cell Macro1!B9 (in this cell, I place the batter name, this will always be in the A column).
    4) Copy cells Bx:Dx (where x is the number that relates to step 3, so if step 3 finds us cell A17, we copy B17:D17, if step 3 finds A31, we copy B31:D31).
    5) Paste into range Macro1!B1:D1
    6) (step 6 - 9 are going to be similar as 2 - 5, but this is for pitcher info). Locate worksheet that has the same name as Macro1!C9.
    7) Locate cell within that worksheet that has the same name as cell Marco1!D9 (this will also be in the A column, as in the team worksheets, pitchers are below the batters, not off to the side).
    8) Copy Bx:Dx
    9) Paste into range Macro1!B2:D2

    X) (these will actually be the last steps, but I'd like to be able to test them) Delete row Marco1!9.
    X+1) repeat marco (until step 1 makes us stop).
    Last edited by OreEle; 07-27-2011 at 02:58 PM. Reason: complying with rules

  2. #2
    Registered User
    Join Date
    06-08-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Macro Making Magic

    Also, this is on Excel 2010 (my home computer uses 2007, but this isn't for home).

+ 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