Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default best way to format on cell change

I want to color a row from column G to AB if range("p" & currentrow) value
changes... currentrow being the row of the cell value that was changed...
how do select the row of the cell that was changed?
Thanks for the help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default best way to format on cell change

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.Column = 16 then
Cells(Target.Row,"G").Resize(1,22).Interior.ColorI ndex = 3
End if
End Sub

Right click on the sheet tab and select view Code.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to color a row from column G to AB if range("p" & currentrow) value
changes... currentrow being the row of the cell value that was changed...
how do select the row of the cell that was changed?
Thanks for the help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default best way to format on cell change

Tom, thanks for the reply. Nothing changes when my cell value changes (it
changes to true of false)... here is the code...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 16 Then
If Target.Value = "true" Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 15
If Target.Value = "false" Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 0
End If
End Sub




"Tom Ogilvy" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.Column = 16 then
Cells(Target.Row,"G").Resize(1,22).Interior.ColorI ndex = 3
End if
End Sub

Right click on the sheet tab and select view Code.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to color a row from column G to AB if range("p" & currentrow) value
changes... currentrow being the row of the cell value that was changed...
how do select the row of the cell that was changed?
Thanks for the help




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default best way to format on cell change

I interpreted your requirement for someone manually making an entry in
column P. If that isn't the requirement, try this revision:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = True Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 15
If Target.Value = False Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = xlNone
End If
End Sub

--
Regards,
Tom Ogilvy



"John" wrote in message
...
Tom, thanks for the reply. Nothing changes when my cell value changes (it
changes to true of false)... here is the code...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 16 Then
If Target.Value = "true" Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 15
If Target.Value = "false" Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 0
End If
End Sub




"Tom Ogilvy" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.Column = 16 then
Cells(Target.Row,"G").Resize(1,22).Interior.ColorI ndex = 3
End if
End Sub

Right click on the sheet tab and select view Code.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to color a row from column G to AB if range("p" & currentrow)

value
changes... currentrow being the row of the cell value that was

changed...
how do select the row of the cell that was changed?
Thanks for the help






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default best way to format on cell change

Tom I appreciate the help, that works. However, my true and false are linked
to checkboxes (if checked cell equals true, if not cell equals false)... if I
check or uncheck my check boxes, which changes column P values, it does not
do the formating. Is this because of the checkboxes?

Thanks again...


"Tom Ogilvy" wrote:

I interpreted your requirement for someone manually making an entry in
column P. If that isn't the requirement, try this revision:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = True Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 15
If Target.Value = False Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = xlNone
End If
End Sub

--
Regards,
Tom Ogilvy



"John" wrote in message
...
Tom, thanks for the reply. Nothing changes when my cell value changes (it
changes to true of false)... here is the code...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 16 Then
If Target.Value = "true" Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 15
If Target.Value = "false" Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 0
End If
End Sub




"Tom Ogilvy" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.Column = 16 then
Cells(Target.Row,"G").Resize(1,22).Interior.ColorI ndex = 3
End if
End Sub

Right click on the sheet tab and select view Code.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to color a row from column G to AB if range("p" & currentrow)

value
changes... currentrow being the row of the cell value that was

changed...
how do select the row of the cell that was changed?
Thanks for the help








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default best way to format on cell change

Are the checkboxes from the control toolbox toolbar or from the forms
toolbar?

Are all the checkboxes located in the same column and positioned over the
row you want to format?

If the checkboxes are from the control toolbox toolbar, are you familiar
with class modules?

In any event, are there formulas that refer to the cells in column P that
would cause a recalculate if their value changed?
--
Regards,
Tom Ogilvy

"John" wrote in message
...
Tom I appreciate the help, that works. However, my true and false are

linked
to checkboxes (if checked cell equals true, if not cell equals false)...

if I
check or uncheck my check boxes, which changes column P values, it does

not
do the formating. Is this because of the checkboxes?

Thanks again...


"Tom Ogilvy" wrote:

I interpreted your requirement for someone manually making an entry in
column P. If that isn't the requirement, try this revision:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = True Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 15
If Target.Value = False Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = xlNone
End If
End Sub

--
Regards,
Tom Ogilvy



"John" wrote in message
...
Tom, thanks for the reply. Nothing changes when my cell value changes

(it
changes to true of false)... here is the code...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 16 Then
If Target.Value = "true" Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 15
If Target.Value = "false" Then
Cells(Target.Row, "G").Resize(1, 22).Interior.ColorIndex = 0
End If
End Sub




"Tom Ogilvy" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.Column = 16 then
Cells(Target.Row,"G").Resize(1,22).Interior.ColorI ndex = 3
End if
End Sub

Right click on the sheet tab and select view Code.

--
Regards,
Tom Ogilvy

"John" wrote in message
...
I want to color a row from column G to AB if range("p" &

currentrow)
value
changes... currentrow being the row of the cell value that was

changed...
how do select the row of the cell that was changed?
Thanks for the help








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
Changing the cell format doesn't change existing cell content Kate Excel Discussion (Misc queries) 2 January 14th 10 04:44 PM
Change Currency Format of Cell based on another Cell Simon Excel Worksheet Functions 2 September 2nd 07 04:53 PM
Can cell format come from and change with reference cell format jclouse Excel Discussion (Misc queries) 1 November 29th 06 03:20 AM
find word in a cell then change cell format [email protected] Excel Programming 2 May 23rd 05 01:21 PM


All times are GMT +1. The time now is 04:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"