Macro help

  • Thread starter Thread starter mikecookaxa
  • Start date Start date
M

mikecookaxa

I need a macro that will cut the final piece of text (in this case a zip
code) and place it into the next cell


A1 A1
A2
123 Anystreet 11111 I want 123 Anystreet 11111
 
Mike,

The following will work in Excel 2000 and later (the Split
function is not available in earlier versions):

Dim V As Variant
V = Split(ActiveCell.Text, " ")
ActiveCell(1, 2).Value = V(UBound(V))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"mikecookaxa"
in message
news:[email protected]...
 
You can also experiment with the Excel Menu:

Select Cell or Cells
Select Data
Select Text To Columns

This splits up text based on your chosen delimeter
 

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

Back
Top