+ Reply to Thread
Results 1 to 6 of 6

Help me Someone!!!!!

Hybrid View

  1. #1
    Registered User
    Join Date
    09-23-2005
    Posts
    2

    Unhappy Help me Someone!!!!!

    ok this is like one hell of a situation..

    i want a code such that when an entire row is selected and colored green, after it is colored, a particular cell in that row gets the value "1"

    what i mean is for eg, if i select row 9 and color it green, then "1" should automatically be entered in Cell "J9". And when i select Row20 and color it green, J20 becomes "1"
    Waht i basically need is for the cell in column "J" of the selected row to change its value to "1"........ Can this be done! I basically use this at work to both track the day's job as well as to sort.. and everytime i color a row i need to manually enter the "1"........

    somebody help!!!!!!!!!!!!!!!
    anyone with the code pls email me if possible at
    [email protected]

  2. #2
    Registered User
    Join Date
    09-20-2005
    Location
    Mönchengladbach, Germany
    Posts
    24
    actually i didn't know what kind of green you mean, so i added every color that seems green to me as constant value
    Const green1 = 4
    Const green2 = 10
    Const green3 = 12
    Const green4 = 43
    Const green5 = 50
    Const green6 = 51
    Private Sub CommandButton1_Click()
    For Each c In ActiveSheet.Columns
    Col = False
    If c.Interior.ColorIndex = green1 Then Col = True
    If c.Interior.ColorIndex = green2 Then Col = True
    If c.Interior.ColorIndex = green3 Then Col = True
    If c.Interior.ColorIndex = green4 Then Col = True
    If c.Interior.ColorIndex = green5 Then Col = True
    If c.Interior.ColorIndex = green6 Then Col = True
    If Col = True Then
      Cells(c.Column, 10) = 1
    End If
    Next c
    End Sub
    tell me if it works, please
    Simon

  3. #3
    Registered User
    Join Date
    09-23-2005
    Posts
    2
    hmm okie i'l try it... if it works i'l give ya whatever u want!!!!!!!!!!

  4. #4
    R. Choate
    Guest

    Re: Help me Someone!!!!!

    FYI - If you continiue to give your real email info in newsgroups you will get spammed bigtime. Spammers harvest email addresses
    here. Most people do something like add the words NOSPAM to their email address and then add a note to remove the NOSPAM if emailing
    to you. Everybody here is accustomed to that. You really wouldn't even have to add the note because that is such a standard
    procedure.

    HTH
    --
    RMC,CPA


    "jenny_gurl" <[email protected]> wrote in message
    news:[email protected]...

    hmm okie i'l try it... if it works i'l give ya whatever u want!!!!!!!!!!


    --
    jenny_gurl
    ------------------------------------------------------------------------
    jenny_gurl's Profile: http://www.excelforum.com/member.php...o&userid=27504
    View this thread: http://www.excelforum.com/showthread...hreadid=470179



  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,514
    In the spirit of, "there is more than one way to do a job." Here's how I think I would approach this.

    Instead of, "If row is green then col J=1" How about, "If J=1, then row is green" Here's how I'd set it up.

    You'll manually enter 1 or 0 into column J like you are now. Select the rows of interest, then Format menu --> conditional formatting --> Formula Is --> $J7=1 (if active cell is in row 7) and set the color to green. Now, instead of going through the format cells dialog to turn the rows green then entering 1's in the green rows, you enter the 1's, and the rows automatically turn green.

    Just another approach that could work for you.

  6. #6
    Jef Gorbach
    Guest

    Re: Help me Someone!!!!!


    "jenny_gurl" <[email protected]> wrote
    in message news:[email protected]...
    >
    > ok this is like one hell of a situation..
    >
    > i want a code such that when an entire row is selected and colored
    > green, after it is colored, a particular cell in that row gets the
    > value "1"
    >
    > what i mean is for eg, if i select row 9 and color it green, then "1"
    > should automatically be entered in Cell "J9". And when i select Row20
    > and color it green, J20 becomes "1"
    > Waht i basically need is for the cell in column "J" of the selected row
    > to change its value to "1"........ Can this be done! I basically use
    > this at work to both track the day's job as well as to sort.. and
    > everytime i color a row i need to manually enter the "1"........
    >
    > somebody help!!!!!!!!!!!!!!!
    > anyone with the code pls email me if possible at
    > '[email protected]' ((mailto: [email protected])
    >
    >
    > --
    > jenny_gurl
    > ------------------------------------------------------------------------
    > jenny_gurl's Profile:

    http://www.excelforum.com/member.php...o&userid=27504
    > View this thread: http://www.excelforum.com/showthread...hreadid=470179
    >


    another alternative:
    Copy/paste the accompanying macro to your personal workbook and assign it to
    a custom toolbar button - clicking it turns entire row your currently in to
    bright green and assigns that row's column:J to 1

    Sub make_row_green()
    With ActiveCell.EntireRow.Interior
    .ColorIndex = 4 'bright green
    .Pattern = xlSolid
    End With
    Range("J" & ActiveCell.Row).Value = 1
    End Sub

    -- jefgorbach at aol



+ 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