Results 1 to 13 of 13

Excel Quirky issue???? with french decimal separators

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    Montreal, Canada
    MS-Off Ver
    Excel 2013
    Posts
    114

    Excel Quirky issue???? with french decimal separators

    Hello, I'm having a wierd issue with vba and it's driving me nuts. I have a macro that produces pricelists and outputs them to pdf, the macro produces bot english and french pdf versions so when it comes to french I have to convert the decimal separator to a comma. problem is the sheet does not take the formatting, the column widths don't get adjusted and the numbers do not get 2 decimal places. But when i put a break point to see where the problem is everything works fine and it takes all the formatting as it should. I have tried turning screen updating back on for this section of code, I have tried making the sheet recalculate, none of it seems to work. please help.

    Chris


    Application.DecimalSeparator = ","
                Application.ThousandsSeparator = " "
                Application.UseSystemSeparators = False
    Sub ColumnSizingILP(SheetNum As Worksheet)
    'Resizes Columns and sets fonts for interchange PDF lists
        Dim ColWidth As Single ' Column width
    
    
        On Error Resume Next
        
        'Set Row Height
            With SheetNum
                With Cells
                    .HorizontalAlignment = xlHAlignCenter
                    .VerticalAlignment = xlVAlignBottom
                    .RowHeight = 13
                End With
                
                With Range("A1").Cells
                    .HorizontalAlignment = xlHAlignCenter
                    .VerticalAlignment = xlVAlignBottom
                    .RowHeight = 26
                End With
    
    
        'Set Fonts
                With Range("A:A,D:E,I:I,L:M").Font
                    .Name = "Arial"
                    .Size = 9
                End With
                
                With Range("B:B,C:C,F:F,J:J,K:K,N:N").Font
                    .Name = "Arial"
                    .Size = 8
                End With
              
               With Range("A1:N1").Font
                    .Name = "Arial"
                    .Size = 8.5
                    .Bold = True
                End With
                
      
        'Set Column Widths and alignment
                With Range("A:A,I:I").Cells
                    .HorizontalAlignment = xlHAlignLeft
                    .IndentLevel = 1
                    .ColumnWidth = 10
                End With
                
                With Range("B:B,J:J").Cells
                    .HorizontalAlignment = xlHAlignCenter
                    .ColumnWidth = 7
                End With
                
                With Range("B1,J1").Cells
                    .WrapText = True
                End With
    
                With Range("D:E,L:M").Cells
                    .NumberFormat = "0.00"
                    .HorizontalAlignment = xlHAlignRight
                    .IndentLevel = 1.5
                    .ColumnWidth = 7
                End With
    
                With Range("C:C,K:K").Cells
                    .HorizontalAlignment = xlHAlignCenter
                    .ColumnWidth = 6
                End With
                    
                With Range("F:F,N:N").Cells
                    .HorizontalAlignment = xlHAlignCenter
                    .ColumnWidth = 7
                End With
                  
                With Range("B1:F1,I1:N1").Cells
                    .HorizontalAlignment = xlHAlignCenter
                End With
                   
                With Range("D1:E1,L1:M1").Cells
                    .HorizontalAlignment = xlHAlignCenter
                    .IndentLevel = 0
                End With
                   
                With Range("G:H").Cells
                    .HorizontalAlignment = xlHAlignLeft
                    .ColumnWidth = 0.25
                End With
        
        'Autofits Interchange Column to fit long codes while keeping the minimum
                ColWidth = Columns("B:B").ColumnWidth
                
                Range("B:B").EntireColumn.AutoFit
                Range("J:J").EntireColumn.AutoFit
            
                If Columns("B:B").ColumnWidth < ColWidth Or Columns("J:J").ColumnWidth < ColWidth Then
                    Columns("B:B,J:J").ColumnWidth = ColWidth
                End If
            
            
            End With
    
    
    End Sub
    Last edited by Code Flunkie; 07-20-2015 at 09:05 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. French format issue for Excel graph not divided by 1000
    By myowntest in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-16-2013, 01:52 AM
  2. [SOLVED] ChangeFormat of column from English decimal system with a dot to French System with a ,
    By rajiv1988 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2013, 04:31 AM
  3. Macro to convert decimal separators from US to EU format when loading a CSV file?
    By Knut Grossmann in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2013, 04:01 PM
  4. Problem with decimal and thousand separators
    By inqmobile in forum Excel General
    Replies: 7
    Last Post: 08-27-2012, 12:10 PM
  5. CSV to Excel European Decimal Issue
    By jbl25 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-05-2012, 11:20 AM
  6. French Excel Macro issue related to cell formats
    By nozerf in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-23-2011, 09:05 AM
  7. IE8.0 & EXCEL Decimal Separator Issue.
    By littlelittle in forum Excel General
    Replies: 0
    Last Post: 08-07-2009, 12:41 PM
  8. [SOLVED] Excel 97/XP Issue with numbers and French machines
    By godburger@hotmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2005, 12:05 AM

Tags for this Thread

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