ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB and Excel (https://www.excelbanter.com/excel-programming/371321-vbulletin-excel.html)

[email protected]

VB and Excel
 
Hi all,

can someone help me find code for highlighting 3 conditions - entire
row interior grey - and 1 when a date is passed to highlight the font
bold red, entire row again?

Also, I need to set a reminder to appear on the first day of every
month when the workbook starts up.

Any help appreciated! :)

Doo


[email protected]

VB and Excel
 
Amendment-

Instead of highlighting the entire row.. how can i highlight a range of
cells?

wrote:
Hi all,

can someone help me find code for highlighting 3 conditions - entire
row interior grey - and 1 when a date is passed to highlight the font
bold red, entire row again?

Also, I need to set a reminder to appear on the first day of every
month when the workbook starts up.

Any help appreciated! :)

Doo



Harald Staff

VB and Excel
 
Have a look at conditional formatting before you decide on a code solution:
http://www.contextures.com/xlCondFormat01.html

HTH. Best wishes Harald

skrev i melding
ups.com...
Hi all,

can someone help me find code for highlighting 3 conditions - entire
row interior grey - and 1 when a date is passed to highlight the font
bold red, entire row again?

Also, I need to set a reminder to appear on the first day of every
month when the workbook starts up.

Any help appreciated! :)

Doo




serial lurker

VB and Excel
 
Try using:
Range(Cells(StartRow, StartColumn), Cells(EndRow, EndColumn)).Select

(StartRow, StartColumn, EndRow & EndColumn must all be numerical. If
the range is only on one row, StartRow = EndRow.)


wrote:
Amendment-

Instead of highlighting the entire row.. how can i highlight a range of
cells?



[email protected]

VB and Excel
 
Thanks folks but i need to highlight more than 3 conditions so it's
gonna have to be code.

I've got this so far:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "L3"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B3:X3")) Is Nothing Then
With Target
Select Case .Value
Case "condition 1": Range("B3:X3").Interior.ColorIndex
= 15
Case "condition 2": Range("B3:X3").Interior.ColorIndex
= 35
Case "", "condition3":
Range("B3:X3").Interior.ColorIndex = 0
Case "condition 4": Range("B3:X3").Interior.ColorIndex
= 0
Case "condition 5": Range("B3:X3").Interior.ColorIndex
= 0


End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

but this only works for one row. Does any one know how to modify it so
it applies to more than 1? Also, i still need to hightlight the row if
a date passes....

Harald Staff wrote:
Have a look at conditional formatting before you decide on a code solution:
http://www.contextures.com/xlCondFormat01.html

HTH. Best wishes Harald

skrev i melding
ups.com...
Hi all,

can someone help me find code for highlighting 3 conditions - entire
row interior grey - and 1 when a date is passed to highlight the font
bold red, entire row again?

Also, I need to set a reminder to appear on the first day of every
month when the workbook starts up.

Any help appreciated! :)

Doo



[email protected]

VB and Excel
 
ooo, n how can i hide my email address like u guys? :P


wrote:
Thanks folks but i need to highlight more than 3 conditions so it's
gonna have to be code.

I've got this so far:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "L3"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B3:X3")) Is Nothing Then
With Target
Select Case .Value
Case "condition 1": Range("B3:X3").Interior.ColorIndex
= 15
Case "condition 2": Range("B3:X3").Interior.ColorIndex
= 35
Case "", "condition3":
Range("B3:X3").Interior.ColorIndex = 0
Case "condition 4": Range("B3:X3").Interior.ColorIndex
= 0
Case "condition 5": Range("B3:X3").Interior.ColorIndex
= 0


End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

but this only works for one row. Does any one know how to modify it so
it applies to more than 1? Also, i still need to hightlight the row if
a date passes....

Harald Staff wrote:
Have a look at conditional formatting before you decide on a code solution:
http://www.contextures.com/xlCondFormat01.html

HTH. Best wishes Harald

skrev i melding
ups.com...
Hi all,

can someone help me find code for highlighting 3 conditions - entire
row interior grey - and 1 when a date is passed to highlight the font
bold red, entire row again?

Also, I need to set a reminder to appear on the first day of every
month when the workbook starts up.

Any help appreciated! :)

Doo



Harald Staff

VB and Excel
 
How many conditions do you need ? Don't expect your users to immediately
understand what your 8 different colors/color combinations are trying to
tell them. Some things make sense on the drawing board only.

HTH. Best wishes Harald


skrev i melding
oups.com...
Thanks folks but i need to highlight more than 3 conditions so it's
gonna have to be code.




Doo0592

VB and Excel
 
I work with cases that can each be at a different status. Some statuses
can be considered cleared. These are the ones i am highlighting. I also
need to highlight them when a set date passes to prompt action to be
taken.

The reminder at workbook/ exel startup is to remind them to archive the
cleared cases.

This formatting will make working these cases a lot easier.


Harald Staff wrote:
How many conditions do you need ? Don't expect your users to immediately
understand what your 8 different colors/color combinations are trying to
tell them. Some things make sense on the drawing board only.

HTH. Best wishes Harald


skrev i melding
oups.com...
Thanks folks but i need to highlight more than 3 conditions so it's
gonna have to be code.




All times are GMT +1. The time now is 11:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com