![]() |
Macro help
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 -- mikecookaxa ------------------------------------------------------------------------ mikecookaxa's Profile: http://www.excelforum.com/member.php...o&userid=27926 View this thread: http://www.excelforum.com/showthread...hreadid=474207 |
Macro help
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" wrote in message ... 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 -- mikecookaxa ------------------------------------------------------------------------ mikecookaxa's Profile: http://www.excelforum.com/member.php...o&userid=27926 View this thread: http://www.excelforum.com/showthread...hreadid=474207 |
Macro help
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 "Chip Pearson" wrote: 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" wrote in message ... 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 -- mikecookaxa ------------------------------------------------------------------------ mikecookaxa's Profile: http://www.excelforum.com/member.php...o&userid=27926 View this thread: http://www.excelforum.com/showthread...hreadid=474207 |
All times are GMT +1. The time now is 11:16 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com