Work with cell contents?

M

murray.r.3

Is it possible within Excel to create a macro to manipulate the
contents of each cell in a column.

The sort of tasks I wish to do include:

(a) Remove spaces. [i.e. "ca ts 5" becomes "cats5"]
(b) Insert character at a certain position [i.e. "12345" becomes
"123-45"]

Thank you
 
M

Mike H

Hi,

Doing those things is relatively simple by either using a macro or a
worksheet function and I'm sure if you can give a more specific example of
what you want then help will be forthcoming.

Mike
 
P

Pete_UK

You can do those two things without a macro.

For the first one, highlight the cells that you want to do this to,
then Edit | Replace (or CTRL-H) and enter:

Find what: <space>
Replace with: leave blank

Then click Replace All.

For the second one you can use a custom format if the numbers are
proper numbers, otherwise you can use a formula with LEFT and RIGHT
functions to insert the hyphen.

Hope this helps.

Pete
 

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