Comma decimal separator turns into dot after Copy code?

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Ok so I have no idea how to help you with the keyboard language thing, here is a thread that may help you: http://www.mrexcel.com/forum/excel-questions/469309-detect-keyboard-language.html

However, I do have a couple of tips for shortening your code: you rarely ever should have to use the "Select" command, and you can combine ranges in one line. For example:

Code:
    'instead of this:
    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
    
    'you could just write
    Range("H16:J19, F16:F19, F21:F22").ClearContents

Additionally:

Code:
   'this:
            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
            
            'could be shortened to:
            Sheets("Sheet1").Range("M" & ActiveCell.Row).Copy
            Sheets("Sheet2").Range("F19").PasteSpecial xlPasteValues
 
Upvote 0
It's a BIG BUG in excel, no one knows how to tackle this. I tried everything, it only Works when Windows and Office are in English. Sorry for big code, it's macro recorded, i'm novice:)
 
Upvote 0
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 :( ;(

YES YES YES YES YES YESSSSSS!
PROBLEM SOLED! Thank You: heinziburli

https://answers.microsoft.com/en-us...view-the/2ceb3ce2-51e7-424c-a8c1-ad96face8164

The answer is: Application.CommandBars.ExecuteMso "FilePrintPreview"
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,900
Members
449,194
Latest member
JayEggleton

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top