+ Reply to Thread
Results 1 to 3 of 3

Seperating Cell contents according to font

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Seperating Cell contents according to font

    Hi Everyone,

    I've got text in cells that is as follows

    Column A
    Excel Microsoft
    Microsoft Excel
    etc
    Is there a way i can seperate this column into columns B and C.
    i.e. I want the Bolded values in column B and the non bold in column C

    Column A                                Column B               Column C
    Excel Microsft                          Excel                  Microsoft 
    Microsoft Excel                         Microsoft              Excel
    Cheers

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Seperating Cell contents according to font

    Is the data always in this format? Couldn't you just use text to columns on the space?

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Seperating Cell contents according to font

    Try This Code

    Sub SplitBold()
    
    Dim i As Long
    Dim c As Integer
    For i = 1 To Cells.SpecialCells(xlCellTypeLastCell).Row
        For c = 1 To VBA.Len(Range("A" & i))
            If Range("A" & i).Characters(c, 1).Caption <> " " Then
                If Range("A" & i).Characters(c, 1).Font.FontStyle = "Bold" Then
                    Range("B" & i) = Range("B" & i) & Range("A" & i).Characters(c, 1).Caption
                    Range("B" & i).Font.Bold = True
                Else
                    Range("C" & i) = Range("C" & i) & Range("A" & i).Characters(c, 1).Caption
                End If
            End If
        Next
    Next
    
    End Sub
    Last edited by Kelshaer; 01-05-2012 at 11:07 AM.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1