Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Palkan

macrumors newbie
Original poster
Jul 2, 2012
2
0
I have a task for Applescript to filter Excel cells based on one criteria "NEW" in column "F" and then copy the filtered cells to a new spreadsheet (new file). I succeeded in filtering the data but now I can't figure out how to copy the result and paste it to the new Excel file. I can not manually define range because the filtered data will be different all the time, so I need automated way to identify the filtered range, select, copy and paste in into new CSV file. Thats what I have so far:

Code:
tell application "Microsoft Excel"
	set myFile to "Macintosh HD:Users:JustDo:Desktop:AppleScript:Template.xlsx"
	set new_book to open workbook workbook file name myFile
	autofilter range range "A1:F1" field "6" criteria1 "NEW" 
end tell

Thanks for your help
 
There is no big reason behind that. At this time I'm just trying to find the best way to perform the task and achieve the result. Maybe VBA would be better, but at this moment I have been playing with AppleScript, thats why I decided to check if it would do that. Ultimately, VBA would work.

Thanks
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.