Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Find a Value and not a Formula

Try the Range property Text:

if len(activecell.text) = 0 then...end if 'cell has empty string
if val(activecell.text)= 0 then...end if 'cell has zero numerical value

"Lenny Amore" wrote in message
...
Hi All,
I have a question that I hope someone can help me with.
I wrote some code that looks at a workbook for a 3 letter
month (example Jan Feb Mar, etc) and then moves one column
over. So for example when it finds the month of Jul it
moves to the value column. OK, I got that part
working...Now I want to look into that cell and find out
if there is a value there. The workbook is linked to
another so that when other people enter data it is
inserted into this workbook. Problem is that if they don't
insert their data I can't go any further so I want my code
to throw an error and say this cell is empty. The problem
is, it is looking at the formula in the cell and therefore
says the cell is not empty. I hope this isn't to
confusing. Below is my code:'Find the Cell corresponding
to current month
Range("A1").Select
Cells.Find(What:=str_month, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Select

If Not IsNull(ActiveCell.Value) Then
'Keep going
'
Else
'stop Generate error message
MsgBox ("There is no FTVR Data")
End If

I would appreciate any help on this.
Thanks,
Lenny




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Find a Value and not a Formula

ok, I don't know what kind of value your users are entering in the other
workbook, is it string or numeric?

string:
First turn display zero off: ActiveWindow.DisplayZeros = False
then this will work: If Len(Activecell.Text)=0 then 'do your error msg

numeric:
is entering 0 allowed? If not, this will work: If Val(Activecell.Value) then
'do your error msg
if entering 0 is allowed, then I haven't a solution to detect if the cell is
empty at the users' end except to go there and look at it directly.

"Lenny Amore" wrote in message
...
The problem is that the cell is linked to another spreadsheet so the is
text in there already. I need it to ignore the formula and tell me say
the value is = to 24 or there is nothing there except the formula which
I need to have ignored.

Thanks,
Lenny



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



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
Find Formula CHARLENE Excel Worksheet Functions 2 January 16th 08 12:13 AM
formula to find a value Charles Excel Worksheet Functions 2 October 16th 07 09:10 PM
Need to find the right formula Matt Bergum Excel Discussion (Misc queries) 2 December 14th 06 07:55 PM
Need to find a formula Lanza52 Excel Worksheet Functions 1 July 13th 06 06:11 AM
Lookup Formula - but have a formula if it can't find/match a value Stephen Excel Worksheet Functions 11 June 14th 05 05:32 AM


All times are GMT +1. The time now is 06:53 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"