Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to have a macro that will set the smallest number in a row (or
in a column) of selected text to BOLD. For example, with A1 = 1,B1 = 2, C1 = 3, D1 = 4 I want the macro to set Cell A1 to be bolded. Art |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Art,
This macro will conditional format the selected range to make minimum value bold. Sub BoldMinimum() Selection.FormatConditions.Delete Selection.FormatConditions.Add _ Type:=xlExpression, Formula1:= _ "=" & ActiveCell.Address(0, 0) & _ "=Min(" & Selection.Address & ")" With Selection.FormatConditions(1).Font .Bold = True .Italic = False End With End Sub HTH Cecil <artengel123 (a) earth (removethis) link.net wrote in message ... I want to have a macro that will set the smallest number in a row (or in a column) of selected text to BOLD. For example, with A1 = 1,B1 = 2, C1 = 3, D1 = 4 I want the macro to set Cell A1 to be bolded. Art |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
These two subs will apply conditional formatting on the either the selected
column or row to accomplish what you requested. Much later than Cecil, but I spent so much time I had to at least send them off! If you add to the row or column, you will need to re-run to extend the formatting to these cells. Sub format_col() Dim last_col As Long Dim col_range As Range last_col = Selection.Column Set col_range = Range(Cells(1, last_col), Cells(Cells(Rows.Count, last_col).End(xlUp).Row, last_col)) With col_range .FormatConditions.Delete .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=MIN(" & col_range.Address & ")" .FormatConditions(1).Font.Bold = True End With End Sub Sub format_row() Dim last_row As Long Dim row_range As Range last_row = Selection.Row Set row_range = Range(Cells(last_row, 1), Cells(last_row, Cells(last_row, Columns.Count).End(xlToLeft).Column)) With row_range .FormatConditions.Delete .FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=MIN(" & row_range.Address & ")" .FormatConditions(1).Font.Bold = True End With End Sub hth, Doug Glancy <artengel123 (a) earth (removethis) link.net wrote in message ... I want to have a macro that will set the smallest number in a row (or in a column) of selected text to BOLD. For example, with A1 = 1,B1 = 2, C1 = 3, D1 = 4 I want the macro to set Cell A1 to be bolded. Art |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
bold text of referenced cell show in formula cell | Excel Worksheet Functions | |||
Alphabetically list of last names: BOLD, not bold | Excel Discussion (Misc queries) | |||
Alphabetically list of names BOLD and NOT bold | Excel Discussion (Misc queries) | |||
Join bold and non-bold text in one cell | Excel Discussion (Misc queries) | |||
How can i test a cell for bold style in a cell (Excel 2003)? | Excel Worksheet Functions |