Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA MACRO 4 ISNUMBER OPERATION
Dear fellows,
I want a simple macro (Not Conditional Formatting), to detect cells in column C:C that are either NOT numbers OR are below 5 and highlight them with Blue Color background and Bold Red color fonts. Regards |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA MACRO 4 ISNUMBER OPERATION
Public Sub ProcessData()
Const TEST_COLUMN As String = "C" '<=== change to suit Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = 1 To iLastRow 'iLastRow to 1 Step -1 If .Cells(i, TEST_COLUMN).Value < "" And _ (Not IsNumeric(.Cells(i, TEST_COLUMN).Value) Or _ Cells(i, TEST_COLUMN).Value < 5) Then With .Cells(i, TEST_COLUMN) .Interior.ColorIndex = 5 .Font.ColorIndex = 3 .Font.Bold = True End With End If Next i End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "FARAZ QURESHI" wrote in message ... Dear fellows, I want a simple macro (Not Conditional Formatting), to detect cells in column C:C that are either NOT numbers OR are below 5 and highlight them with Blue Color background and Bold Red color fonts. Regards |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA MACRO 4 ISNUMBER OPERATION
Sorry Bob but code is not working!
Can you simply write a code to highlight the cell (C5) to Blue if its value is not numeric and similarly... highlight the cell (C6) to Blue if its value is numeric but below < 5? "Bob Phillips" wrote: Public Sub ProcessData() Const TEST_COLUMN As String = "C" '<=== change to suit Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = 1 To iLastRow 'iLastRow to 1 Step -1 If .Cells(i, TEST_COLUMN).Value < "" And _ (Not IsNumeric(.Cells(i, TEST_COLUMN).Value) Or _ Cells(i, TEST_COLUMN).Value < 5) Then With .Cells(i, TEST_COLUMN) .Interior.ColorIndex = 5 .Font.ColorIndex = 3 .Font.Bold = True End With End If Next i End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "FARAZ QURESHI" wrote in message ... Dear fellows, I want a simple macro (Not Conditional Formatting), to detect cells in column C:C that are either NOT numbers OR are below 5 and highlight them with Blue Color background and Bold Red color fonts. Regards |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA MACRO 4 ISNUMBER OPERATION
I responded to another question from you on that using conditional
formatting. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "FARAZ QURESHI" wrote in message ... Sorry Bob but code is not working! Can you simply write a code to highlight the cell (C5) to Blue if its value is not numeric and similarly... highlight the cell (C6) to Blue if its value is numeric but below < 5? "Bob Phillips" wrote: Public Sub ProcessData() Const TEST_COLUMN As String = "C" '<=== change to suit Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = 1 To iLastRow 'iLastRow to 1 Step -1 If .Cells(i, TEST_COLUMN).Value < "" And _ (Not IsNumeric(.Cells(i, TEST_COLUMN).Value) Or _ Cells(i, TEST_COLUMN).Value < 5) Then With .Cells(i, TEST_COLUMN) .Interior.ColorIndex = 5 .Font.ColorIndex = 3 .Font.Bold = True End With End If Next i End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "FARAZ QURESHI" wrote in message ... Dear fellows, I want a simple macro (Not Conditional Formatting), to detect cells in column C:C that are either NOT numbers OR are below 5 and highlight them with Blue Color background and Bold Red color fonts. Regards |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
VBA MACRO 4 ISNUMBER OPERATION
Sorry BOB but your answer to the other question i.e. using feature of
Conditional Formatting was not useful. I simply want to know the structure of a VBA CODE in this regard. Please let me know if u can. Thanx "Bob Phillips" wrote: I responded to another question from you on that using conditional formatting. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "FARAZ QURESHI" wrote in message ... Sorry Bob but code is not working! Can you simply write a code to highlight the cell (C5) to Blue if its value is not numeric and similarly... highlight the cell (C6) to Blue if its value is numeric but below < 5? "Bob Phillips" wrote: Public Sub ProcessData() Const TEST_COLUMN As String = "C" '<=== change to suit Dim i As Long Dim iLastRow As Long With ActiveSheet iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row For i = 1 To iLastRow 'iLastRow to 1 Step -1 If .Cells(i, TEST_COLUMN).Value < "" And _ (Not IsNumeric(.Cells(i, TEST_COLUMN).Value) Or _ Cells(i, TEST_COLUMN).Value < 5) Then With .Cells(i, TEST_COLUMN) .Interior.ColorIndex = 5 .Font.ColorIndex = 3 .Font.Bold = True End With End If Next i End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "FARAZ QURESHI" wrote in message ... Dear fellows, I want a simple macro (Not Conditional Formatting), to detect cells in column C:C that are either NOT numbers OR are below 5 and highlight them with Blue Color background and Bold Red color fonts. Regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ISNUMBER | Excel Worksheet Functions | |||
ISNUMBER | Excel Worksheet Functions | |||
Complex Macro to perform an operation as it steps down cells? | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |