View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
kiat kiat is offline
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