Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Font question

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a sheet who I want the column A make bold.See the following macro I wrote:
    With Cells(10, 1).Font
    .Name = "Arial"
    .Size = 10
    .FontStyle = "Bold"
    End With

    In this macro only the cell of row 10 change in bold.I want to have all the cells in column A change in bold,but I don't know in advance ho many rows there are.It is variable.

    Anyone a solution on this.
    Many thanks

  2. #2
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is something like this any good to you?


    With ActiveSheet.UsedRange.Columns("A").Font
    .Name = "Arial"
    .Size = 10
    .FontStyle = "Bold"
    End With


  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-22 13:53, Mark O'Brien wrote:
    Is something like this any good to you?


    With ActiveSheet.UsedRange.Columns("A").Font
    .Name = "Arial"
    .Size = 10
    .FontStyle = "Bold"
    End With

    Many thanks,that's what I need.
    (Is there also a code so that all the text in cell are on the left in the cell?)

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Text ie JACK in left or should be right is value and numbers, so you need to convert to text the whole column in this case..

    Simple is add col and convert then CPAV (copy / paste as value) silly but will left align im sure.

    =text(cell, 0 )
    then CPAV

    Caution XP will not like this and all sorts will pop up even green triangles. XP is winding me up!


    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-22 14:03, Jack in the UK wrote:
    Hi

    Text ie JACK in left or should be right is value and numbers, so you need to convert to text the whole column in this case..

    Simple is add col and convert then CPAV (copy / paste as value) silly but will left align im sure.

    =text(cell, 0 )
    then CPAV

    Caution XP will not like this and all sorts will pop up even green triangles. XP is winding me up!



    I mean the code in VBA to add at my macro,so that all the text in column A is on the left side and not central or right of the cell.
    Thanks for this adding code.

  6. #6
    MrExcel MVP Mark O'Brien's Avatar
    Join Date
    Feb 2002
    Location
    Columbus, OH, USA
    Posts
    3,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    verluc,

    You mean something like this?


    With ActiveSheet.UsedRange.Columns("A")
    With .Font
    .Name = "Arial"
    .Size = 10
    .FontStyle = "Bold"
    End With
    .HorizontalAlignment = xlLeft
    End With


    HTH

  7. #7
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-22 14:28, Mark O'Brien wrote:
    verluc,

    You mean something like this?


    With ActiveSheet.UsedRange.Columns("A")
    With .Font
    .Name = "Arial"
    .Size = 10
    .FontStyle = "Bold"
    End With
    .HorizontalAlignment = xlLeft
    End With


    HTH
    Sorry Mark,but I get an error on this.
    Can you see it?
    Thanks

  8. #8
    Board Regular
    Join Date
    Feb 2002
    Location
    Huntington Beach, CA USA
    Posts
    327
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    It looks like the problem is that you have 2
    "End With" , remove 1 and it should be fine

    James

  9. #9
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-22 14:42, James wrote:
    It looks like the problem is that you have 2
    "End With" , remove 1 and it should be fine

    James
    James,I have removed the first "End With" and I get still the same error.

  10. #10
    Board Regular
    Join Date
    Feb 2002
    Location
    Huntington Beach, CA USA
    Posts
    327
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sorry, i didn't realize the 2nd "End With"
    should have been End Sub, just type End Sub
    as the last line in the code

    James

Some videos you may like

User Tag List

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
  •