Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

splitting cells in excel

Status
Not open for further replies.

char8026

Technical User
Jul 18, 2002
1
US
I am having a hard time trying to figure out how to split cells in Excel. My dillemma is I have a column heading and then need two sub headings. Any and all help would be great.

TIA,

Char
 
Hi,
I never construct tables with heading in more than 1 row.

However, for display purposes, if you do not plan to use this table for lookup or database purposes, then this is what I would recommend...

1. For the major heading, merge two cells and center -- there's a toolbar icon for this

2. On the second row enter your two sub-headings

3. To unify the appearance of the table, merge cells in rows 1 & 2 for all other headings, using horizontal and vertical centering

Hope this helps :)

Skip,
SkipAndMary1017@mindspring.com
 
Hi,

Perhaps if your header has a space or something you can put between the two sub headings then the following would work. You would need to put getStrItem(strData, iPosition, strDelim) in the relevant cells where you wanted the split, strDelim is "_" or "." (to split the two sub headings out of the heading.

Function getStrItem(strData, iPosition, strDelim) As String 'Return the data in position iPosition of the string

Dim iElement() As String

iElement = Split(strData, strDelim, -1)
getStrItem = iElement(iPosition - 1)

End Function 'getStrItem

Don't know if this is what you need but it may be of some help. I would not use this function if you have loads of headings to split because it can get quite slow.
Cheers, Alistair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top