Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    May 2008
    Location
    India
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In a particular wb, I am not able to format the cell in Comma Style. A sample sheet is attached for reference. Pl advise.
    Attached Files Attached Files
    Regards
    Prasad

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The workbook contains very strange style definitions.
    Select Format | Style...
    Select Comma from the Style name dropdown.
    You'll see that no number format has been specified.
    Tick the Number check box and click OK.

    You may want to clean up the list of styles - there are far too many of them!

  3. #3
    3 Star Lounger
    Join Date
    May 2008
    Location
    India
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The workbook contains very strange style definitions.
    Really strange. Actually, part of wb is received from some other source and I never noticed these definitions.

    You may want to clean up the list of styles - there are far too many of them!.
    Should I clean up the styles one by one or is there some quick way? Attached sheet contains sample of styles and cell formatting on applying comma style. I want these to merge in problematic wb. Pl help.
    Attached Files Attached Files
    Regards
    Prasad

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I ran the following macro to delete custom styles:

    Code:
    Sub DeleteStyles()
      Dim i As Integer
      On Error Resume Next
      For i = ActiveWorkbook.Styles.Count To 1 Step -1
    	If Not ActiveWorkbook.Styles(i).BuiltIn Then
    	  ActiveWorkbook.Styles(i).Delete
    	End If
      Next i
    End Sub
    I then opened Book2.xls, and used Merge... in the Format | Styles... dialog to import the styles from Book2.xls.

    See the attached version.
    Attached Files Attached Files

  5. #5
    3 Star Lounger
    Join Date
    May 2008
    Location
    India
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Grrrrrrrrrr8.

    Thanks champ.

    Regards
    Prasad

  6. #6
    3 Star Lounger
    Join Date
    May 2008
    Location
    India
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There are 2 ways to format a cell in particular pattern. First is Format -->Style and second one is through Format -->Cell -->Number-->Custome (if it is added in type). I just want to know the difference between these two applications. Pl correct my understanding if I am wrong.
    Regards
    Prasad

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Let's say that you create a style "MyStyle", with number format 0.000 and font Arial.
    You apply MyStyle to 100 cells. Those 100 cells will have number format 0.000 and font Arial.
    Now you modify the style MyStyle to use number format 0.0 and font Times New Roman.
    The 100 cells will automatically use the new number format 0.0 and font Times New Roman - you don't have to reapply the style or format the cells.

    So you can use styles to maintain consistency of formatting - you don't have to search for cells that have number format 0.000 and font Arial and change their formatting, you only have to modify the style.

    The Comma button on the toolbar doesn't apply a number format directly, it applies the Comma style to the selected cells.
    Similarly, the Percent button on the toolbar applies the Percent style, and the Currency button applies the Currency style.

  8. #8
    3 Star Lounger
    Join Date
    May 2008
    Location
    India
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So you can use styles to maintain consistency of formatting - you don't have to search for cells that have number format 0.000 and font Arial and change their formatting, you only have to modify the style.
    Got it.

    Thanks Hans.
    Regards
    Prasad

Posting Permissions

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