+ Reply to Thread
Results 1 to 4 of 4

How to make some text in a Cell Bold?

Hybrid View

v2jtb How to make some text in a... 04-29-2012, 07:55 AM
StevenM Re: How to make some text in... 04-29-2012, 08:54 AM
v2jtb Re: How to make some text in... 04-29-2012, 10:40 AM
StevenM Re: How to make some text in... 04-29-2012, 11:00 AM
  1. #1
    Registered User
    Join Date
    01-29-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    94

    How to make some text in a Cell Bold?

    Hi all,

    I have the following code that selects the text in Cell (O "whatever") adds a line then the date and time, then adds another line with Reopened and the text you enter in the inputbox.

    I would like to make the last line from Reopened show as bold? Can this be done?

    Also any way to make the last three lines with Borders.LineStyle = xlThin = 2, HorizontalAlignment = xlLeft and VerticalAlignment = xlTop into one line?

      testme = Worksheets("Open").Cells(nextrow, "O").Value
                ReopenStr = testme & vbLf & Now & " - " & "Reopened" & " - " & strResult
                Worksheets("Open").Cells(nextrow, "O").Value = ReopenStr
                
                Worksheets("Open").Range("A" & nextrow, "O" & nextrow).VerticalAlignment = xlTop
                Worksheets("Open").Range("A" & nextrow, "O" & nextrow).HorizontalAlignment = xlLeft
                Worksheets("Open").Range("A" & nextrow, "O" & nextrow).Borders.LineStyle = xlThin = 2

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: How to make some text in a Cell Bold?

    Perhaps something like:

        testme = Worksheets("Open").Cells(nextrow, "O").Value
        ReopenStr = testme & vbLf & Now & " - " & "Reopened" & " - " & strResult
        Worksheets("Open").Cells(nextrow, "O").Value = ReopenStr
        Worksheets("Open").Cells(nextrow, "O").Font.Bold = True
                    
        With Worksheets("Open").Range("A" & nextrow, "O" & nextrow)
            .VerticalAlignment = xlTop
            .HorizontalAlignment = xlLeft
            .Borders.LineStyle = xlThin = 2
        End With

  3. #3
    Registered User
    Join Date
    01-29-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: How to make some text in a Cell Bold?

    Thank you for the quick response.
    I was able to shorten the code by adding a with, job done thank you.
    With regards to the Bold, I was I really only want to Bold the Now (Time stamp),
    I did not explain too well sorry.

    ReopenStr = testme & vbLf & Now & " - " & "Reopened" & " - " & strResult

  4. #4
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: How to make some text in a Cell Bold?

    The basic idea is like this:

    Cells(1, 1).Characters(Start:=5, Length:=2).Font.Bold = True

+ 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