I have a NOOB question. I want to copy a range of cells and then Paste Special with values only to a different area of the same worksheet. Here is how I attempted to accomplish this without success:
tell application "Microsoft Excel"
copy range range "B5:E258"
goto reference "I5"
paste special paste values
end tell
I am new to this stuff so I know I am missing something. Any help with this problem is greatly appreciated.
Scripting the Microsoft Office products can be tricky. Maybe the following sample code will work for you?
tell application "Microsoft Excel"
tell worksheet 1 of active workbook
copy range (range "B5:E258")
paste special (range "I5") what paste values
end tell
end tell
Here is a good online resource about how to copy & paste values in Microsoft Excel:
This works perfect. Thank you so much. This puts me on the right track. Our office has a excel workbook we use for payroll that has quite a few macros in it that we have been using for several years. Now that Office will no longer support VBA. I am trying to convert our worksheet macros over to Applescript so we will be ready. I can see that this forum will be a great resource. Thanks again Martin.