replace all chars with carriage return

C

caca

Been wondering this for ages, since the windows methods do not seem to
apply
to mac...

How do you enter a return into a field in Excel, and how would one find
and
replace across a column for one character, and turn it into a carriage
return.
 
P

Paul Berkowitz

Been wondering this for ages, since the windows methods do not seem to
apply
to mac...

How do you enter a return into a field in Excel, and how would one find
and
replace across a column for one character, and turn it into a carriage
return.


I just answered that on another list. You could use VBA (going away soon),
or you could use AppleScript in Excel 2004.


Just run the following one-line script in Script Editor, using whatever
character you want to replace instead of "f":


tell application "Microsoft Excel"
replace (used range of active sheet) what "f" replacement (return)
end tell


That will do a "Replace All" for the whole spreadsheet. If you want to
restrict it to just one column, for example column "C", do this:


tell application "Microsoft Excel"
replace (range "C:C") what "f" replacement (return)
end tell


or just in selected cells:


tell application "Microsoft Excel"
replace selection what "f" replacement (return)
end tell


--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top