Results 1 to 3 of 3

Need to add * symbol to the begining and end of every cell

This is a discussion on Need to add * symbol to the begining and end of every cell within the Excel Questions forums, part of the Question Forums category; How can I use cell formating to add * symbol to the begining and end of the text in a ...

  1. #1
    New Member
    Join Date
    May 2003
    Posts
    1

    Default Need to add * symbol to the begining and end of every cell

    How can I use cell formating to add * symbol to the begining and end of the text in a cell regargless of its contents. I need to do this to convert a large list of serial number to a barcode font.

    Thnaks for your help!

  2. #2
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    61,948

    Default Re: Need to add * symbol to the begining and end of every ce

    Quote Originally Posted by mrhague
    How can I use cell formating to add * symbol to the begining and end of the text in a cell regargless of its contents. I need to do this to convert a large list of serial number to a barcode font.

    Thnaks for your help!
    Formatting would not affect the contents...

    Try...

    ="*"&A1&"*"

  3. #3
    MrExcel MVP phantom1975's Avatar
    Join Date
    Jun 2002
    Location
    Omaha, Nebraska
    Posts
    3,947

    Default Re: Need to add * symbol to the begining and end of every ce

    If you DO need to affect the values, the following macro will do the trick:

    Code:
    Sub Add_Stars()
    Dim ThisCell As Range
    Dim MyRange As Range
        Set MyRange = Range("A1:G15")
        For Each ThisCell In MyRange
            If ThisCell.Value <> "" Then
                ThisCell.Value = "*" & ThisCell.Value & "*"
            End If
        Next ThisCell
    End Sub
    Silly Billy was here....

    ***************** EXCEL/VB NEWBIES ARE MY FAVORITE! *****************

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com