+ Reply to Thread
Results 1 to 8 of 8

Changing Cell Font and Color Issue,

  1. #1
    RitaG
    Guest

    Changing Cell Font and Color Issue,

    Hi,

    I'm updating an Excel 2003 spreadsheet dynamically.
    I set the font for the current cell I'm working with but the
    results do not reflect the font name. The other attributes are correct.
    I checked to see if the font name is valid and it is.
    Here's my code:
    '*** Change the font for just this cell
    With Selection.Font
    .Name = "Ariel Narrow"
    .Bold = True
    .Size = 9
    End With
    I changed the .Name to "Book Antigua" and that worked fine.

    Another issue I have is trying to set a different cell to a certain color.
    It's just not working. Here's the code (lLastColumn has a value of 33):
    '*** Extend the Navy Blue color in row 2, last column created
    wshFIC.Cells(2, lLastColumn).Select
    Selection.Interior.ColorIndex = 2

    Any suggestion will be greatly appreciated!

    Rita

  2. #2
    Trevor Shuttleworth
    Guest

    Re: Changing Cell Font and Color Issue,

    Rita

    on my computer, it is spelt "Arial Narrow". Guess that's what it is on
    yours and the root of your problem.

    Regards

    Trevor


    "RitaG" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I'm updating an Excel 2003 spreadsheet dynamically.
    > I set the font for the current cell I'm working with but the
    > results do not reflect the font name. The other attributes are correct.
    > I checked to see if the font name is valid and it is.
    > Here's my code:
    > '*** Change the font for just this cell
    > With Selection.Font
    > .Name = "Ariel Narrow"
    > .Bold = True
    > .Size = 9
    > End With
    > I changed the .Name to "Book Antigua" and that worked fine.
    >
    > Another issue I have is trying to set a different cell to a certain color.
    > It's just not working. Here's the code (lLastColumn has a value of 33):
    > '*** Extend the Navy Blue color in row 2, last column created
    > wshFIC.Cells(2, lLastColumn).Select
    > Selection.Interior.ColorIndex = 2
    >
    > Any suggestion will be greatly appreciated!
    >
    > Rita




  3. #3
    Carole O
    Guest

    RE: Changing Cell Font and Color Issue,

    Try Arial instead of Ariel.

    HTH,

    Carole O

    "RitaG" wrote:

    > Hi,
    >
    > I'm updating an Excel 2003 spreadsheet dynamically.
    > I set the font for the current cell I'm working with but the
    > results do not reflect the font name. The other attributes are correct.
    > I checked to see if the font name is valid and it is.
    > Here's my code:
    > '*** Change the font for just this cell
    > With Selection.Font
    > .Name = "Ariel Narrow"
    > .Bold = True
    > .Size = 9
    > End With
    > I changed the .Name to "Book Antigua" and that worked fine.
    >
    > Another issue I have is trying to set a different cell to a certain color.
    > It's just not working. Here's the code (lLastColumn has a value of 33):
    > '*** Extend the Navy Blue color in row 2, last column created
    > wshFIC.Cells(2, lLastColumn).Select
    > Selection.Interior.ColorIndex = 2
    >
    > Any suggestion will be greatly appreciated!
    >
    > Rita


  4. #4
    RitaG
    Guest

    RE: Changing Cell Font and Color Issue,

    Oops! Thanks!

    "Carole O" wrote:

    > Try Arial instead of Ariel.
    >
    > HTH,
    >
    > Carole O
    >
    > "RitaG" wrote:
    >
    > > Hi,
    > >
    > > I'm updating an Excel 2003 spreadsheet dynamically.
    > > I set the font for the current cell I'm working with but the
    > > results do not reflect the font name. The other attributes are correct.
    > > I checked to see if the font name is valid and it is.
    > > Here's my code:
    > > '*** Change the font for just this cell
    > > With Selection.Font
    > > .Name = "Ariel Narrow"
    > > .Bold = True
    > > .Size = 9
    > > End With
    > > I changed the .Name to "Book Antigua" and that worked fine.
    > >
    > > Another issue I have is trying to set a different cell to a certain color.
    > > It's just not working. Here's the code (lLastColumn has a value of 33):
    > > '*** Extend the Navy Blue color in row 2, last column created
    > > wshFIC.Cells(2, lLastColumn).Select
    > > Selection.Interior.ColorIndex = 2
    > >
    > > Any suggestion will be greatly appreciated!
    > >
    > > Rita


  5. #5
    Peter T
    Guest

    Re: Changing Cell Font and Color Issue,

    >
    > Another issue I have is trying to set a different cell to a certain color.
    > It's just not working. Here's the code (lLastColumn has a value of 33):
    > '*** Extend the Navy Blue color in row 2, last column created
    > wshFIC.Cells(2, lLastColumn).Select
    > Selection.Interior.ColorIndex = 2
    >
    > Any suggestion will be greatly appreciated!



    Hi Rita,

    You have answers for your Font issue. And on to your blues.

    Are you trying to fill with a dark blue, if so Colorindex 2 is white,
    assuming you have a default / uncustomized palette.

    Not sure what dark blue you want (11 ?) so pick from this:

    Sub clrIndexes()
    For i = 1 To 56
    Cells(i, 1).Interior.ColorIndex = i
    Cells(i, 2).Value = i
    Next
    End Sub

    Index's 17 - 32 are the chart colours which you won't see on the drop down
    palette of 40.

    Regards,
    Peter T



  6. #6
    RitaG
    Guest

    Re: Changing Cell Font and Color Issue,

    Thanks so much to all who responed!
    I never realized that the color palette numbers for Excel are different,
    hence 2 being white when I expected it to be navy. BTW, I used 25.
    All's well that ends well...

    "Peter T" wrote:

    > >
    > > Another issue I have is trying to set a different cell to a certain color.
    > > It's just not working. Here's the code (lLastColumn has a value of 33):
    > > '*** Extend the Navy Blue color in row 2, last column created
    > > wshFIC.Cells(2, lLastColumn).Select
    > > Selection.Interior.ColorIndex = 2
    > >
    > > Any suggestion will be greatly appreciated!

    >
    >
    > Hi Rita,
    >
    > You have answers for your Font issue. And on to your blues.
    >
    > Are you trying to fill with a dark blue, if so Colorindex 2 is white,
    > assuming you have a default / uncustomized palette.
    >
    > Not sure what dark blue you want (11 ?) so pick from this:
    >
    > Sub clrIndexes()
    > For i = 1 To 56
    > Cells(i, 1).Interior.ColorIndex = i
    > Cells(i, 2).Value = i
    > Next
    > End Sub
    >
    > Index's 17 - 32 are the chart colours which you won't see on the drop down
    > palette of 40.
    >
    > Regards,
    > Peter T
    >
    >
    >


  7. #7
    Peter T
    Guest

    Re: Changing Cell Font and Color Issue,

    Glad you got it all sorted.

    > BTW, I used 25.


    That's the same colour (in a default palette) as #11, as I guessed.
    #25 is a chart colour, absolutely no problem to apply that but don't be
    surprised if you "return" in code the color-index of the same colour that
    you've applied manually from the palette as #11. As I said before, #17 to
    #32 are the chart colours not visible in the dropdown palette, ten of which
    are duplicates of the other forty.

    > I never realized that the color palette numbers for Excel are different,
    > hence 2 being white when I expected it to be navy


    Curiosity - different to what?

    Regards,
    Peter T


    > Thanks so much to all who responed!
    > I never realized that the color palette numbers for Excel are different,
    > hence 2 being white when I expected it to be navy. BTW, I used 25.
    > All's well that ends well...
    >
    > "Peter T" wrote:
    >
    > > >
    > > > Another issue I have is trying to set a different cell to a certain

    color.
    > > > It's just not working. Here's the code (lLastColumn has a value of

    33):
    > > > '*** Extend the Navy Blue color in row 2, last column created
    > > > wshFIC.Cells(2, lLastColumn).Select
    > > > Selection.Interior.ColorIndex = 2
    > > >
    > > > Any suggestion will be greatly appreciated!

    > >
    > >
    > > Hi Rita,
    > >
    > > You have answers for your Font issue. And on to your blues.
    > >
    > > Are you trying to fill with a dark blue, if so Colorindex 2 is white,
    > > assuming you have a default / uncustomized palette.
    > >
    > > Not sure what dark blue you want (11 ?) so pick from this:
    > >
    > > Sub clrIndexes()
    > > For i = 1 To 56
    > > Cells(i, 1).Interior.ColorIndex = i
    > > Cells(i, 2).Value = i
    > > Next
    > > End Sub
    > >
    > > Index's 17 - 32 are the chart colours which you won't see on the drop

    down
    > > palette of 40.
    > >
    > > Regards,
    > > Peter T
    > >
    > >
    > >




  8. #8
    RitaG
    Guest

    Re: Changing Cell Font and Color Issue,

    Hi Peter,
    In response to your question "Curiosity - different to what?" - check out
    http://www.mvps.org/dmcritchie/excel/colors.htm.

    It talks about the DOS assignments of 16 colors, etc.

    Rita

    "Peter T" wrote:

    > Glad you got it all sorted.
    >
    > > BTW, I used 25.

    >
    > That's the same colour (in a default palette) as #11, as I guessed.
    > #25 is a chart colour, absolutely no problem to apply that but don't be
    > surprised if you "return" in code the color-index of the same colour that
    > you've applied manually from the palette as #11. As I said before, #17 to
    > #32 are the chart colours not visible in the dropdown palette, ten of which
    > are duplicates of the other forty.
    >
    > > I never realized that the color palette numbers for Excel are different,
    > > hence 2 being white when I expected it to be navy

    >
    > Curiosity - different to what?
    >
    > Regards,
    > Peter T
    >
    >
    > > Thanks so much to all who responed!
    > > I never realized that the color palette numbers for Excel are different,
    > > hence 2 being white when I expected it to be navy. BTW, I used 25.
    > > All's well that ends well...
    > >
    > > "Peter T" wrote:
    > >
    > > > >
    > > > > Another issue I have is trying to set a different cell to a certain

    > color.
    > > > > It's just not working. Here's the code (lLastColumn has a value of

    > 33):
    > > > > '*** Extend the Navy Blue color in row 2, last column created
    > > > > wshFIC.Cells(2, lLastColumn).Select
    > > > > Selection.Interior.ColorIndex = 2
    > > > >
    > > > > Any suggestion will be greatly appreciated!
    > > >
    > > >
    > > > Hi Rita,
    > > >
    > > > You have answers for your Font issue. And on to your blues.
    > > >
    > > > Are you trying to fill with a dark blue, if so Colorindex 2 is white,
    > > > assuming you have a default / uncustomized palette.
    > > >
    > > > Not sure what dark blue you want (11 ?) so pick from this:
    > > >
    > > > Sub clrIndexes()
    > > > For i = 1 To 56
    > > > Cells(i, 1).Interior.ColorIndex = i
    > > > Cells(i, 2).Value = i
    > > > Next
    > > > End Sub
    > > >
    > > > Index's 17 - 32 are the chart colours which you won't see on the drop

    > down
    > > > palette of 40.
    > > >
    > > > Regards,
    > > > Peter T
    > > >
    > > >
    > > >

    >
    >
    >


+ 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