HELP:
First time ‘scripter’ here.
PROBLEM:
I have imported data into Excel that I wish to format. The current script I managed to create gives me positive results but it keeps getting stuck on the first cell it sees when the script matches the parameters I’ve set.[#RED BOLD for text “0 out of (wildcard)” & #Bold text “Question (wildcard)”]
REQUEST:
- Stop the script form getting stuck and continue to search and apply formatting.
- I would like my script to format the entire worksheet.
- It doesn’t necessarily have to be “1:500”. I just don’t know how to make it see only ‘true’ (filled) cells.
- BONUS SCRIPT: I would LOVE to add a feature where it would insert a blank row above rows containing “Question *”
tell application "Microsoft Excel"
tell active workbook
tell active sheet
set colStart to (get first column index of selection)
set rowStart to (get first row index of selection)
set colCount to (get count columns of selection)
set rowCount to (get count rows of selection)
print rowCount
##################
#DELETE text "Selected Answer:"
##################
select range "A1"
set i to 1
repeat 100 times
try
set FoundCell1 to (find range "1:500" what "Selected Answer:")
delete FoundCell1
on error
exit repeat
end try
end repeat
##################
#RED BOLD for text "0 out of (wildcard)"
##################
select range "A1"
set i to 1
repeat 100 times
set i to i + 1
try
set FoundCell2 to (find range "1:500" what "0 out of*")
tell FoundCell2
set font style of font object of FoundCell2 to "Bold"
set color of font object to {255, 0, 0}
end tell
on error
exit repeat
end try
end repeat
##################
#Bold text "Question (wildcard)"
##################
select range "A1"
set i to 1
repeat 100 times
set i to i + 1
try
set FoundCell3 to (find range "1:500" what "Question*")
tell FoundCell3
set font style of font object of FoundCell3 to "Bold"
end tell
on error
exit repeat
end try
end repeat
end tell
end tell
end tell
Thank you for your time.
-slowpokezzz-
AppleScript: 2.4 v2.7 (176)
Browser: Chrome ver 39.0.2171.71 (64-bit)
Operating System: Mac OS X (10.8)