Hello,
I’m fairly new to applescripting, but I have a basic understanding. I wrote the script below in an attempt to delete rows which have the same value applied to a cell as the row above it. Problem is, I keep getting an error “Microsoft Excel got an error: The object you are trying to access does not exist”. The value is found in the first cell, but when it checks the next cell something isn’t right. When I “get properties” of the cell in question, the values show up. Here’s the script:
tell application “Microsoft Excel”
set lastRow to ((count of rows of used range of active sheet) + 1)
set currRow to 1
set c to “B”
repeat until currRow = lastRow
set currSKU to string value of cell (c & currRow) of active sheet --as text
set nextSKU to string value of cell {c & currRow + 1} of active sheet --as text
if currSKU = nextSKU then
delete row (currRow)
end if
set currRow to (currRow + 1)
end repeat
end tell