Excel Range Questions
Excel Range Questions
- Subject: Excel Range Questions
- From: Oakley Masten <email@hidden>
- Date: Fri, 12 Mar 2004 10:34:53 -0600
Good Morning to all again
Another issue has popped up.
I am working on a script to rename files using an Excel Spread sheet
for reference.
I first needed to know the total number of rows so I wrote the
following script to find out.
It works fine but because I want to use the most elegant and therefore
simple code possible is there a better way?
tell application "Microsoft Excel"
Activate
set countcols to 0
set CellNums to "R1C1"
set TheEndCell to false
repeat until TheEndCell
set countcols to countcols + 1
set CellNums to "R" & (countcols as text) & "C1"
set x to text of Cell CellNums
--display dialog "Cell " & CellNums & " is <" & x & ">"
if countcols > 50 then
exit repeat
end if
if x = "" then
exit repeat
end if
end repeat
display dialog "Last column is number " & countcols - 1
end tell
Thanks in advance
Oakley
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.