LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default problem determining a cell's value

I have an add-in to excel that I have referenced in a formula. The add-in
retrieves a value from a database. When a value is not found, it displays
'No events found.' In an IF THEN ELSE statement, I'm checking for 'No events
found.', but when the cell meets that criteria it is not matching and just
goes to the 'Error' part of my Else statement (see below). My guess is that
my statement is retrieving the formula in the cell, and not the formula's
results. If I do a MSGBOX, I get the results and not the formula. Any
thoughts?

If (IsNumeric(Worksheets("Data").Range("A7").Value)) Then
MsgBox Worksheets("Data").Range("A7").Value 'show the value
ElseIf CStr(Worksheets("Data").Range("A7").Value) = "No events found."
Then
MsgBox "No events found."
Else
MsgBox "Error"
End If

I've tried it with and without the CStr function to see if it was a format
conversion issue to no avail.

Thanks
 
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
Determining if Value In List E.Q. Excel Discussion (Misc queries) 2 April 18th 06 06:05 PM
need help determining a row number Gary Keramidas Excel Programming 7 November 13th 05 03:54 AM
Determining End Of data bnhcomputing[_2_] Excel Programming 2 September 27th 05 11:25 PM
How do I make a cell's contents equal to another cell's contents with macro program? mgmcdevitt[_10_] Excel Programming 2 September 15th 05 09:44 PM
birthdays - determining when due mcraig Excel Discussion (Misc queries) 4 August 7th 05 03:50 PM


All times are GMT +1. The time now is 07:37 PM.

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

About Us

"It's about Microsoft Excel"