c45
asked on
Excel, make a field bold if a condition is met
Hi,
Do I have to write some VB in a macro to accomplish the following ? and if so am I along the right lines of thinking here.
1) Range l3-l17 has times in it.
2) I need to get the earliest time so a (Min function)
3) Then in the Range b3-j17 i have various times in each cell
If any of the times in the b3-j17 range is >= the min value in Range i3-i17 the value in that cell needs to be bold.
so from research I came up with this..
a) is it correct
b) where do i place it in excel macros. ?
Sub BoldHours()
Application.ScreenUpdating = False
Dim c As Long
For Each c = 2 to 10 ' this covers column b to J
ActiveSheet.AutoFilterMode = False
With Range("b3:j17").Offset(0, c - 1)
.Font.Bold = False
.AutoFilter Field:=1, Criteria1:=">=min( l3:l17)"
.Font.Bold = True
End With
Next
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub
Do I have to write some VB in a macro to accomplish the following ? and if so am I along the right lines of thinking here.
1) Range l3-l17 has times in it.
2) I need to get the earliest time so a (Min function)
3) Then in the Range b3-j17 i have various times in each cell
If any of the times in the b3-j17 range is >= the min value in Range i3-i17 the value in that cell needs to be bold.
so from research I came up with this..
a) is it correct
b) where do i place it in excel macros. ?
Sub BoldHours()
Application.ScreenUpdating
Dim c As Long
For Each c = 2 to 10 ' this covers column b to J
ActiveSheet.AutoFilterMode
With Range("b3:j17").Offset(0, c - 1)
.Font.Bold = False
.AutoFilter Field:=1, Criteria1:=">=min( l3:l17)"
.Font.Bold = True
End With
Next
ActiveSheet.AutoFilterMode
Application.ScreenUpdating
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You have closed the question (grading as a 'B') without allowing me time to respond.
I am sorry I was not able to return to reply immediately upon your re-evaluation of your requirements, but I am now presuming you no longer wish to receive any assistance.
I am sorry I was not able to return to reply immediately upon your re-evaluation of your requirements, but I am now presuming you no longer wish to receive any assistance.
ASKER
I mis spoke, The Min Value has to be from a range in another cell group.
See attached.
I wish to examine the cells B1-j15 and see if any of the times are greater than the earliest time in cells l1:l15
if they are they need to be bold or change color.
I have changed the colors of the cells manually to show what the correct ones should be.
thanks
helpq.xlsx