Help me Someone!!!!!

  • Thread starter Thread starter jenny_gurl
  • Start date Start date
J

jenny_gurl

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
'(e-mail address removed)' ((mailto: (e-mail address removed))
 
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
 
hmm okie i'l try it... if it works i'l give ya whatever u want!!!!!!!!!!
 
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



hmm okie i'l try it... if it works i'l give ya whatever u want!!!!!!!!!!
 
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
 
jenny_gurl said:
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
'(e-mail address removed)' ((mailto: (e-mail address removed))

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top