Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error Indicators in Cells

Can the subject error indicators be accessed through VBA & how?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Error Indicators in Cells

in excel 97, (e.g. A1 = 0, B1 = 1/A1), in debug window:
?cverr(activesheet.range("b1"))
Error 2007

does this help?
--END

"Trevor" wrote in message ...
Can the subject error indicators be accessed through VBA & how?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error Indicators in Cells

Not really.

What I was trying to access is the error indicators like "The number in
this cell if formatted as text...."

Thanks




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Error Indicators in Cells

Take a look at ErrorCheckingOptions in VBA's help.

From there, you can click on "see also" and go to "Error Object" and see code
like this:


Option Explicit
Sub testme01()
Dim myCell As Range

Set myCell = ActiveSheet.Range("B3")

If myCell.Errors.Item(xlNumberAsText).Value = True Then
MsgBox "Might be an error"
Else
MsgBox "nope, not even a warning"
End If

End Sub


Trevor Fernandes wrote:

Not really.

What I was trying to access is the error indicators like "The number in
this cell if formatted as text...."

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Error Indicators in Cells

Just note that these were added in xl2002 and would not be available in any
earlier version (if you are writing code to distribute).

--
Regards,
Tom Ogilvy

Dave Peterson wrote in message
...
Take a look at ErrorCheckingOptions in VBA's help.

From there, you can click on "see also" and go to "Error Object" and see

code
like this:


Option Explicit
Sub testme01()
Dim myCell As Range

Set myCell = ActiveSheet.Range("B3")

If myCell.Errors.Item(xlNumberAsText).Value = True Then
MsgBox "Might be an error"
Else
MsgBox "nope, not even a warning"
End If

End Sub


Trevor Fernandes wrote:

Not really.

What I was trying to access is the error indicators like "The number in
this cell if formatted as text...."

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error Indicators in Cells

In the KB article Q291047 it is stated:

Method 1: Use the Error Button
If the cells in which numbers are displayed as text contain an error
indicator in the upper-left corner, follow these steps:
Click the cell that contains the error indicator.
Click the error button next to the cell, and then click Convert to
Number on the shortcut menu

How can I do the same thing through VBA?

Thanks
Trevor



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Error Indicators in Cells

One way is to just reset the numberformat to general and plop the value back in
the

Option Explicit
Sub testme01()

With activesheet.Range("b9")
'just test data!
.NumberFormat = "@" 'make it text
.Value = 1234

'do the real work
.NumberFormat = "General"
.Value = .Value

End With

End Sub

Trevor Fernandes wrote:

In the KB article Q291047 it is stated:

Method 1: Use the Error Button
If the cells in which numbers are displayed as text contain an error
indicator in the upper-left corner, follow these steps:
Click the cell that contains the error indicator.
Click the error button next to the cell, and then click Convert to
Number on the shortcut menu

How can I do the same thing through VBA?

Thanks
Trevor

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


--

Dave Peterson

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
Comments Without Indicators; Displayed when Cells are Clicked katzy Excel Discussion (Misc queries) 2 April 21st 08 09:47 PM
Hiding error indicators MrBlades Excel Discussion (Misc queries) 1 April 11th 08 10:02 PM
Can one comment have two indicators? sewall_c Excel Discussion (Misc queries) 1 August 24th 07 06:14 PM
Comment Indicators Mandy Excel Worksheet Functions 2 July 18th 06 12:23 AM
Comment Indicators ????? Excel Discussion (Misc queries) 1 December 4th 04 12:45 AM


All times are GMT +1. The time now is 09:57 PM.

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"