Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 ' ((mailto: ) -- 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() actually i didn't know what kind of green you mean, so i added ever color that seems green to me as constant value Code ------------------- 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 Su ------------------- tell me if it works, please :) Simo -- moondar ----------------------------------------------------------------------- moondark's Profile: http://www.excelforum.com/member.php...fo&userid=2739 View this thread: http://www.excelforum.com/showthread.php?threadid=47017 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() In the spirit of, "there is more than one way to do a job." Here's ho I think I would approach this. Instead of, "If row is green then col J=1" How about, "If J=1, then ro is green" Here's how I'd set it up. You'll manually enter 1 or 0 into column J like you are now. Selec the rows of interest, then Format menu -- conditional formatting -- Formula Is -- $J7=1 (if active cell is in row 7) and set the color t green. Now, instead of going through the format cells dialog to tur 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 -- MrShort ----------------------------------------------------------------------- MrShorty's Profile: http://www.excelforum.com/member.php...fo&userid=2218 View this thread: http://www.excelforum.com/showthread.php?threadid=47017 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "jenny_gurl" wrote in message ... 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 ' ((mailto: ) -- 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|