ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Highight cell with non numeric data (https://www.excelbanter.com/excel-programming/423508-highight-cell-non-numeric-data.html)

Billy[_7_]

Highight cell with non numeric data
 

I'm getting this error

compile error : invalid or unqualified reference



If !IsNumeric((Cells(Row, 11).Value)) Then
Cells(Row, 11).Interior.ColorIndex = 4
End If


I just want to validate that the data in the cell is numeric.

Paul Wilson

Highight cell with non numeric data
 
Billy,

Remove the ! mark, then it should work.


If IsNumeric((Cells(Row, 11).Value)) Then
Cells(Row, 11).Interior.ColorIndex = 4
End If

Paul


"Billy" wrote in message
...

I'm getting this error

compile error : invalid or unqualified reference



If !IsNumeric((Cells(Row, 11).Value)) Then
Cells(Row, 11).Interior.ColorIndex = 4
End If


I just want to validate that the data in the cell is numeric.




Billy[_7_]

Highight cell with non numeric data
 
figured it out


If Not IsNumeric


Paul Wilson

Highight cell with non numeric data
 
Sorry This should have read

If Not(IsNumeric((Cells(Row, 11).Value))) Then
Cells(Row, 11).Interior.ColorIndex = 4
End If


as you are testing for non-numeric values.
Paul


"Billy" wrote in message
...

I'm getting this error

compile error : invalid or unqualified reference



If !IsNumeric((Cells(Row, 11).Value)) Then
Cells(Row, 11).Interior.ColorIndex = 4
End If


I just want to validate that the data in the cell is numeric.





All times are GMT +1. The time now is 06:36 PM.

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