If i may post link to question from OzGrid? Sorry MrExcel
Comma decimal separator turns into dot after Copy code?
Comma decimal separator turns into dot after Copy code?
Sub pRINT_FUEL_REPORT()
'
' PRINT_FUEL_REPORT Macro
'
On Error Goto ifERROR
'This is in case if selected out of print range but clicking print in cell("V1")
If ActiveCell.Column() > 21 Or ActiveCell.Row() > 61 Or ActiveCell.Row() = 1 _
Or ActiveCell.Value = "" Then
MsgBox " W R O N G R A N G E !" & vbNewLine & " " & vbNewLine & _
" OR THERE IS NO PRINTABLE DATA !", 64, ""
Goto ifERROR
Else
Dim MSG As String, ANS As Variant
MSG = " DO YOU WANT PRINT REPORT?" & " " & _
Range("A" & ActiveCell.Row) & " " & Range("C" & ActiveCell.Row)
ANS = MsgBox(MSG, vbQuestion + vbYesNo + vbDefaultButton2, "Print report")
Select Case ANS
Case vbYes
Application.ScreenUpdating = False
Range("A" & ActiveCell.Row).Select
Selection.Copy
Sheets("Sheet2").Select
Range("C4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("B" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("C6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("C" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("C7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("E" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("C9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("D" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("K9").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("F" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("F16").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("G" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("H14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("H" & ActiveCell.Row & ":K" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("G12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("L" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("F18").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("M" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("F19").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("N" & ActiveCell.Row & ":Q" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("G13").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("R" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("F17").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("S" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("F21").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("T" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("F22").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Sheet1").Select
Range("U" & ActiveCell.Row).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("H16:J19").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll DOWN:=-30
Range("A1:L30").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
' In case there is no printing device:
On Error Resume Next
Application.Dialogs(xlDialogPrinterSetup).Show
Selection.PrintOut Preview:=True
On Error Goto 0
Application.ScreenUpdating = False
Range("H16:J19").Select
Selection.ClearContents
Range("F22").Select
Selection.ClearContents
Range("F21").Select
Selection.ClearContents
Range("F19").Select
Selection.ClearContents
Range("F18").Select
Selection.ClearContents
Range("F16:F17").Select
Range("F17").Activate
Selection.ClearContents
ActiveWindow.SmallScroll DOWN:=-18
Range("G12:J14").Select
Selection.ClearContents
Range("K9").Select
Selection.ClearContents
Range("C9").Select
Selection.ClearContents
Range("C7").Select
Selection.ClearContents
Range("C6").Select
Selection.ClearContents
Range("C4").Select
Selection.ClearContents
Sheets("Sheet1").Select
ActiveWindow.SmallScroll ToLeft:=12
Range("A1").Select
Application.ScreenUpdating = True
Case vbNo
Goto QUIT:
End Select
ifERROR:
End If
Exit Sub
QUIT:
End Sub
It is so weird problem. After I print report, I just lose european keyboard layout, numerical side of keyboard, comma goes into dot. But only inside Excel, not Outlook, not inside WindowsPlease, MrExcel, may I upload workbook.xlsm ? Please.
And only after printing on paper. When I choose to cancel print in PrintPreview there is no error.It is so weird problem. After I print report, I just lose european keyboard layout, numerical side of keyboard, comma goes into dot. But only inside Excel, not Outlook, not inside Windows
' In case there is no printing device:
On Error Resume Next
Application.Dialogs(xlDialogPrinterSetup).Show
Selection.PrintOut Preview:=True
I figured out after three months. Problem is in PrintPreview, but WHYYY MICROSOFT, WHY!
Code:' In case there is no printing device: On Error Resume Next Application.Dialogs(xlDialogPrinterSetup).Show Selection.PrintOut Preview:=True
When i set Selection.PrintOut Preview:=False everything is fine, no error.
But, why! I really need print preview ;(