Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Formula | Excel Worksheet Functions | |||
formula to find a value | Excel Worksheet Functions | |||
Need to find the right formula | Excel Discussion (Misc queries) | |||
Need to find a formula | Excel Worksheet Functions | |||
Lookup Formula - but have a formula if it can't find/match a value | Excel Worksheet Functions |