excel - find value and exit loop

Hey all,

I’m searching through the forums but there are like 268 pages to go through so I thought I’d also try posting.

in excel:

  1. find a value ex. “Feb” (unsure of the find command in excel through applescript)

  2. if it exists exit and assign the value to a variable.

any help would be appreciated.

So far

  1. find a value ex. “Feb” (unsure of the find command in excel through applescript)

tell application "Microsoft Excel"
	activate object sheet "Sheet1"
	set gc to (find (range "a:a") what "zz")
end tell

Question:
How do you handle if the text does not exist?

Hi,

for example with a try block, because Excel throws an error, if there is no match

tell application "Microsoft Excel"
	activate object sheet "Sheet1"
	try
		set gc to (find (range "a:a") what "zz")
	on error
		display dialog "Mo match found"
	end try
end tell