How do i use applescript to clear a range of cells in excel 2008

I am a total newbie as far as apple script is concerned. i have just upgraded to excel 2008 from 2004, i had a macro to clear a range of cells which does not work in 2008. Can anyone tell
how i go about using apple script to do this.
Thank you

tell application "Microsoft Excel"
	
	clear range range "A1:D5" of sheet "Sheet1" of workbook "Workbook1"
	
end tell

Downloading the Apple Script reference from MicroSoft was a big help to me.
As was http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
and establishing the Excel library in Script Editor.

Thanks
Can you tell how to edit this script to include multiple ranges
thanks again

What have you tried and how did it fail?
What cells do you want cleared?

This is great is there a way to clear only the contents and leave the cell boarder in tact?

Update: Please disregard problem solved in second AppleScript, leaving it here incase it helps anyone else, more then likely me as I look for the solution again in the future :slight_smile:

Currently I am doing something like this but I really don’t like all the error messages I get for cells that have formulas that reference the cells I have cleared. I really want the equivalent of what would happen when you select the cells and press the forward delete key. In short I am looking to just clear the contents of the cells and not add a space like I am doing below.

--http://www.mactech.com/articles/mactech/Vol.23/23.02/2302AppleScript/index.html
tell application "Microsoft Excel"
	activate object worksheet "Daily Did"

	--Monday
	set range1 to range "E3:F58"
	set value of range1 to {" "}
	
	--Tuesday
	set range2 to range "L3:M58"
	set value of range2 to {" "}
	
	--Wednesday
	set range3 to range "S3:T58"
	set value of range3 to {" "}
	
	--Thursday
	set range4 to range "Z3:AA58"
	set value of range4 to {" "}
	
	--Friday
	set range5 to range "AG3:AH58"
	set value of range5 to {" "}
	
	--Saturday
	set range6 to range "AN3:AO58"
	set value of range6 to {" "}
	
	Sunday
	set range7 to range "AU3:AV58"
	set value of range7 to {" "}
	
end tell

Update: I could have sworn I did this hours ago and it didn’t work but just did it again with out the space and the cells were cleared without removing formatting or borders.

--http://www.mactech.com/articles/mactech/Vol.23/23.02/2302AppleScript/index.html
tell application "Microsoft Excel"
	activate object worksheet "Daily Did"
	
	--Monday
	set range1 to range "E3:F58"
	set value of range1 to {""}
	
	--Tuesday
	set range2 to range "L3:M58"
	set value of range2 to {""}
	
	--Wednesday
	set range3 to range "S3:T58"
	set value of range3 to {""}
	
	--Thursday
	set range4 to range "Z3:AA58"
	set value of range4 to {""}
	
	--Friday
	set range5 to range "AG3:AH58"
	set value of range5 to {""}
	
	--Saturday
	set range6 to range "AN3:AO58"
	set value of range6 to {""}
	
	Sunday
	set range7 to range "AU3:AV58"
	set value of range7 to {""}
	
end tell