Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can i copy only part of a cell to another?

Status
Not open for further replies.

pcaok

Technical User
Dec 26, 2000
6
US
Example: a cells contents is a text string followed by a phone number. The phone number will always be xxx-xxx-xxxx (area code, and then the number). What would I have to do to create a macro to move the phone number only, out of the cell, to the next cell over... (text and phone number in A1) leaving text in A1 and moving phone number to B1. I want to be able to do this repetitively.

Thanks
 
In column B, assuming you start with row 2, type:

=right(a2,12)

(copy the new phone numbers, keep range selected, then hit Edit-paste special-values to get rid of the =right formula)

If the text in column A is the exact same number of characters, you can insert another column B and type

=left(a2,10) (where 10 is the number of characters in the text)

I forget how to do it otherwise, something like:

=len(a2-len(right(a2,12)) or something like that.

Try using the function helper with the len (length) function.

If no one else comes in, reply anyway and I'll get it for you.
techsupportgirl@home.com
Brainbench MVP for Microsoft Word
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top