Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
43fan
 
Posts: n/a
Default Function to format cells???

I have a series of data that gets pulled into a worksheet(it's pulled into a
"data" sheet first from a text file, then creates a "report" from the data
in the worksheet). In most cases, the one set of data will have a product
number and a item number separated by a dash. I have a function that takes
only the portion of the number after the dash, puts a comma after it, then
the next item, comma, etc. This works great for all but one customer, who
doesn't have dashes! Of course, right!? ;) Anyway, what I end up doing is
formatting the cell then to allow wrapping, and then manually adjusting the
width of the cell so it wraps right at the comma.

Is there any way to do this automatically? IOW, when it doesn't find a
dash, set it to wrap text, at the comma(actually, right after the comma)?

Thanks!
Shawn


  #2   Report Post  
Landxlii
 
Posts: n/a
Default

=IF(C2=1,"abcdefg","abcd<alt-enter-symbolefg");
this will wrap the text "abcdefg" after the "d" if cell C1 is not equal to
1.

I copied the alt-enter special character from a line of text and pasted it
into the formula above at the place marked <alt-enter-symbol but you can
just hit alt-enter at that spot in the formula.
NB. The cell containing the formula needs to be formatted as wrapped text,
otherwise you will see a square.


"43fan" wrote in message
...
I have a series of data that gets pulled into a worksheet(it's pulled into

a
"data" sheet first from a text file, then creates a "report" from the data
in the worksheet). In most cases, the one set of data will have a product
number and a item number separated by a dash. I have a function that

takes
only the portion of the number after the dash, puts a comma after it, then
the next item, comma, etc. This works great for all but one customer,

who
doesn't have dashes! Of course, right!? ;) Anyway, what I end up doing

is
formatting the cell then to allow wrapping, and then manually adjusting

the
width of the cell so it wraps right at the comma.

Is there any way to do this automatically? IOW, when it doesn't find a
dash, set it to wrap text, at the comma(actually, right after the comma)?

Thanks!
Shawn






  #3   Report Post  
43fan
 
Posts: n/a
Default

Landxlii,

This is close, but I don't have the experience to fix it. I'm wondering if
this would be something that'd be better to "program" as a function?

The problem with this is that for the report, I'm pulling information from
another worksheet in the workbook. Right now to get the numbers after the
dash and put the comma's in where they're supposed to be, I use this:

=rightofdash('Veh 1 Data'!$J1) & "," & rightofdash('Veh 1 Data'!$J2) & "," &
rightofdash('Veh 1 Data'!$J3) & "," & rightofdash('Veh 1 Data'!$J4)

with "rightofdash" being a function that finds the dash, then pulls just the
characters to the right of it. As you can see, I then concatenate them
together to put the commas in.

What I need to do is, with data that doesn't have the dash, is go ahead and
concatenate them with the commas, but then have the cell automatically wrap
and adjust to size, so the commas are in a line at the right.

Something like this:
Data before formatting: abcd,efgh,ijkl

Data after formatting:
abcd,
efgh,
ijkl

Can you help?

Thanks!!
Shawn

"Landxlii" wrote in message
...
=IF(C2=1,"abcdefg","abcd<alt-enter-symbolefg");
this will wrap the text "abcdefg" after the "d" if cell C1 is not equal to
1.

I copied the alt-enter special character from a line of text and pasted it
into the formula above at the place marked <alt-enter-symbol but you can
just hit alt-enter at that spot in the formula.
NB. The cell containing the formula needs to be formatted as wrapped text,
otherwise you will see a square.


"43fan" wrote in message
...
I have a series of data that gets pulled into a worksheet(it's pulled

into
a
"data" sheet first from a text file, then creates a "report" from the

data
in the worksheet). In most cases, the one set of data will have a

product
number and a item number separated by a dash. I have a function that

takes
only the portion of the number after the dash, puts a comma after it,

then
the next item, comma, etc. This works great for all but one customer,

who
doesn't have dashes! Of course, right!? ;) Anyway, what I end up doing

is
formatting the cell then to allow wrapping, and then manually adjusting

the
width of the cell so it wraps right at the comma.

Is there any way to do this automatically? IOW, when it doesn't find a
dash, set it to wrap text, at the comma(actually, right after the

comma)?

Thanks!
Shawn








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
Min/Max formulas using cells with date format WDS2000 Excel Worksheet Functions 1 February 7th 05 06:03 PM
Format cells as date bay Excel Discussion (Misc queries) 3 January 26th 05 05:34 PM
How do I unhide the cell format function in Excel 2000 Len Melcer Excel Worksheet Functions 2 December 15th 04 06:49 PM
Protected cells -automatically format to a different color Fred Evans Excel Discussion (Misc queries) 9 December 3rd 04 12:59 PM
When I select "format cells", the format dialog box does not disp. Andy S. Excel Worksheet Functions 2 November 23rd 04 03:49 AM


All times are GMT +1. The time now is 12:30 AM.

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

About Us

"It's about Microsoft Excel"