LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Use a function to format cells?

I have a report that I run in Excel, which pulls data from a text file into
a worksheet, placing each value in a cell, and then pulls info from these
cells to create a report. One cell in particular normally has a series of
characters/numbers then a dash, then another series of characters/numbers.
I pull just the characters/numbers to the right of the dash to print on the
report, several of these actually, well, four to be exact, and concatenate
them with a comma separating. Problem is, for one customer in particular,
their item number doesn't have dashes. This then makes the data on the
report look weird with that one cell all stretched out like that, so I
manually set the format of the cell to wrap text, then resize the cell so
all the comma's line up to the right. I'd like to do this either using
worksheet functions(I posted there as well) or, using a "macro" function.

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

Thanks!!
Shawn


 
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
Excel 2007 format cells to date format Stefan Excel Discussion (Misc queries) 0 June 1st 10 09:06 PM
want format cells alignment not format cells font style Jeannie Bean Excel Discussion (Misc queries) 2 February 10th 06 09:31 AM
Cells won't convert to number format, even after format/cells/num. scottr Excel Discussion (Misc queries) 5 April 12th 05 11:02 PM
Function to format cells??? 43fan Excel Worksheet Functions 2 March 2nd 05 01:45 PM
Function: Join Cells with Format Alexey E. Kolmyk Excel Programming 3 December 13th 03 03:09 PM


All times are GMT +1. The time now is 08:34 PM.

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"