Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default 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
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
ISNUMBER Michael Nol Excel Worksheet Functions 1 March 22nd 06 12:29 AM
ISNUMBER RJJ Excel Worksheet Functions 8 January 4th 06 11:29 PM
Complex Macro to perform an operation as it steps down cells? Jeni Q Excel Worksheet Functions 0 August 25th 05 04:38 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 07:17 AM.

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

About Us

"It's about Microsoft Excel"