• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Value of an empty cell in Numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Value of an empty cell in Numbers


  • Subject: Re: Value of an empty cell in Numbers
  • From: Deivy Marck Petrescu <email@hidden>
  • Date: Wed, 4 Feb 2009 10:24:39 -0500


On Feb 4, 2009, at 5:03 AM, KOENIG Yvan wrote:

Here is an enhanced version of the handler doYourDuty()

--=====

on doYourDuty(r, c, t, s)
local tName, newTable, errMsg, errNum, sheetName, flag

tell application "Numbers09" to tell document 1
if value of cell r of column c of table t of sheet s is not 0.0 then
set flag to false
else
tell sheet 1
set tName to "temporary_yraropmet"
set newTable to make new table with properties {name:tName}
try
newTable as text
on error errMsg number errNum
set sheetName to item 4 of my decoupe(errMsg, quote)
end try
end tell -- sheet 1

tell sheet sheetName
tell table tName (*
assuming that r,c points cell H12, inserts the localized formula =ISBLANK(H12) *)
set value of cell 1 of row 1 to "=" & ISBLANK_loc & "(" & s & " :: " & t & " :: " & my refEnLettres(r, c) & ")"
(* grabs the returned value *)
set flag to value of cell 1 of row 1
end tell -- tName
delete table tName (* removes the temporary table *)
end tell -- sheet sheetName
end if
end tell -- document 1 of application
return flag
end doYourDuty

--=====

No need to create the auxiliary table if the grabbed cell value is not 0.0.

Yvan KOENIG (from FRANCE mercredi 4 février 2009 11:02:12) _______________________________________________

Yvan, 
if I am creating the table I use 1E-5, for instance, as the value for a *0* cell. Then  when I look for a cell that it is empty, my zero will not be flagged.
The problem is, what if the table exists already?
Then I think your idea of creating a new table and using isblank is excellent.

I wrote the following script to check if it is empty using your idea.
Notice that the repeat is only on the "0" valued cells of a range.

----------
tell application "Numbers" to tell document 1 to tell sheet 1
set nom to name of table 1
tell table nom
set l to row 2  -- use column for column ranges
set ecell to name of every cell of l whose value is 0
end tell
return my emptycells(nom, ecell)
end tell

on emptycells(nome, lcell)
tell application "Numbers" to tell document 1 to tell sheet 1
set nutable to make new table at front with properties {name:"temp", column count:2, row count:2}
set torf to {}
repeat with r in lcell
set r to contents of r
tell table "temp"
set value of cell "B2" to "=ISBLANK(" & nome & " :: " & r & ")"
if (get value of cell "B2") = true then set end of torf to r
end tell
end repeat
delete table "temp"
return torf
end tell
end emptycells

------------
Thank you!


Deivy Petrescu
email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Value of an empty cell in Numbers
      • From: KOENIG Yvan <email@hidden>
References: 
 >Value of an empty cell in Numbers (From: Deivy Marck Petrescu <email@hidden>)
 >Re: Value of an empty cell in Numbers (From: KOENIG Yvan <email@hidden>)
 >Re: Value of an empty cell in Numbers (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: Value of a date in Numbers
  • Next by Date: Re: Value of a date in Numbers
  • Previous by thread: Re: Value of an empty cell in Numbers
  • Next by thread: Re: Value of an empty cell in Numbers
  • Index(es):
    • Date
    • Thread