+ Reply to Thread
Results 1 to 3 of 3

Select Row determined by Variable

  1. #1
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    Select Row determined by Variable

    Good Morning,

    Basically I'm trying to come up with a script that selects a row based on a cell value.

    I have an If clause that finds each cell in a range that is colored purple and returns it's value to another cell on a separate sheet.

    What i'm trying to do now is to select the 1st cell of each row and return it's value to another cell on a separate sheet.

    ActiveCell isn't helping with this because since this macro is on a separate sheet, it won't look up the correct rows.

    Can anyone help with this? Much appreciated!!!

    Below is my code, the bolded part is the problematic portion:

    For Each Cell In SrcRng1
    If Cell.Interior.Color = RGB(112, 48, 160) Then
    Job = Cell
    Rows(Cell.row).Select
    Selection.Cells(1, 1).Select


    NextJob.Select
    ActiveCell = Job
    NextTech.Select
    ActiveCell = Tech

    Set NextJob = NextJob.Offset(1, 0)
    Set NextTech = NextTech.Offset(1, 0)
    End If
    Next Cell
    Last edited by Pergo; 04-02-2011 at 12:23 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Select Row determined by Variable

    If you're using Excel 2003, I think you should be testing the ColorIndex property, not Color.

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-20-2010
    Location
    Delaware, USA
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Select Row determined by Variable

    This worked! Thank you soooooo much!!!

+ 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