Determining if a cell value is an integer
Closed
mtbtweety
Posts
1
Registration date
Tuesday March 3, 2009
Status
Member
Last seen
March 4, 2009
-
Mar 4, 2009 at 01:08 PM
WutUp WutUp - Mar 4, 2009 at 04:15 PM
WutUp WutUp - Mar 4, 2009 at 04:15 PM
Hello,
I'm getting type mismatch errors in a Macro, and am trying to resolve it by checking to see if the cell contains an integer, but can't figure out how to do that.
Current line is
If Selection.Cells(i) > 0 Then l = l + 1
I'd like ti to be more like
If (Selection.Cells(i) > 0 AND Selection.Cells(i).type=Integer) Then l = l + 1
but that clearly doesn't work. What's the right language for this?
I'm getting type mismatch errors in a Macro, and am trying to resolve it by checking to see if the cell contains an integer, but can't figure out how to do that.
Current line is
If Selection.Cells(i) > 0 Then l = l + 1
I'd like ti to be more like
If (Selection.Cells(i) > 0 AND Selection.Cells(i).type=Integer) Then l = l + 1
but that clearly doesn't work. What's the right language for this?
Related:
- Determining if a cell value is an integer
- C++ 64 bit integer - Guide
- If cell contains date then return value ✓ - Excel Forum
- If cell A1 has text then cell B2 has today's Date ✓ - Excel Forum
- Count if cell contains number - Excel Forum
- If cell contains text then return value multiple conditions ✓ - Excel Forum