Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Spread data and keep format

I have some strings in column A that appear like:

123.123.1234.123456.123.12.123
000.000.0000.000000.000.00.000
123.456.0000.987654.444.00.222

They all follow the same pattern. I want to keep column A intact, but spread
the values across seven columns to the right. Like so (the pipes below denote
columns):

B C D E F G H
123 | 000 | 1234 | 123456 | 999 | 00 | 95

Note that I need to keep the requisite number of zeros after the spread, so
text-to-columns fails, since '000' translates as '0'.

I would like a speadsheet function and/or VBA code that would do this
correctly. Many thanks for your assistance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Spread data and keep format

DataText to Columns will not fail when done correctly.

Select the range in column A

DataText to ColumnsDelimitedOther enter a periodNextSelect all columns by
Shift + Click and Column Data FormatText

Destination....select a cell...say B1........ and Finish


Gord Dibben MS Excel MVP

On Fri, 4 Jan 2008 13:16:07 -0800, XP wrote:

I have some strings in column A that appear like:

123.123.1234.123456.123.12.123
000.000.0000.000000.000.00.000
123.456.0000.987654.444.00.222

They all follow the same pattern. I want to keep column A intact, but spread
the values across seven columns to the right. Like so (the pipes below denote
columns):

B C D E F G H
123 | 000 | 1234 | 123456 | 999 | 00 | 95

Note that I need to keep the requisite number of zeros after the spread, so
text-to-columns fails, since '000' translates as '0'.

I would like a speadsheet function and/or VBA code that would do this
correctly. Many thanks for your assistance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Spread data and keep format

On Jan 5, 8:16 am, XP wrote:
I have some strings in column A that appear like:

123.123.1234.123456.123.12.123
000.000.0000.000000.000.00.000
123.456.0000.987654.444.00.222

They all follow the same pattern. I want to keep column A intact, but spread
the values across seven columns to the right. Like so (the pipes below denote
columns):

B C D E F G H
123 | 000 | 1234 | 123456 | 999 | 00 | 95

Note that I need to keep the requisite number of zeros after the spread, so
text-to-columns fails, since '000' translates as '0'.

I would like a speadsheet function and/or VBA code that would do this
correctly. Many thanks for your assistance.


In B1 use the formula...

="." & A1

filled down to add a "." to the start of each string.
Then use Edit|Replace to replace each "." with ".a"
Then use Data|Text to Columns with "." as the delimiter
This produces the correct result except they all have "a" as a prefix.
Use =MID(B1,2,LEN(B1)-1) filled across for a total of 7 columns then
down the sheet to get rid of the "a" prefix.

When I did this the 0000s stayed.

Ken Johnson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Spread data and keep format

I wish I had seen Gord's before I submitted my crap(:-\

Ken Johnson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i enter a bull call spread into the options spread sheet ? alvin smith Excel Worksheet Functions 0 November 27th 06 01:23 AM
Cell format has suddenly changed in all new spread sheets Andy Excel Discussion (Misc queries) 5 October 29th 06 08:16 AM
How can I look up data in a different workbook in an excel spread. DoctorG Excel Worksheet Functions 10 January 13th 06 09:18 PM
spread sheet should have fraction for format like 1/32 too worksheet Excel Discussion (Misc queries) 3 January 13th 06 03:06 AM
can I clean old excel data format with macro on funny spread sheet Todd F.[_2_] Excel Programming 0 July 22nd 05 09:15 PM


All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"