ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Erroneous Macro Recording (https://www.excelbanter.com/excel-programming/441435-erroneous-macro-recording.html)

Fabian

Erroneous Macro Recording
 
Hi,

Macro-recording doesn't seem to handle the German decimal point "," all too
well.

Using the Macro-Recorder when changing the unit in a Pivot table, the
algorithm generates:

Sub ChangeUnit()
'
' ChangeUnit Makro
'
' Tastenkombination: Strg+q
'
With ActiveSheet.PivotTables("PivotTable1").PivotFields ( _
"Mittelwert von Cost per kW")
.NumberFormat = "#.##0,00 ""‚¬/kW"""
End With
End Sub

.... whereas is should generate ...

Sub ChangeUnit()
'
' ChangeUnit Makro
'
' Tastenkombination: Strg+q
'
With ActiveSheet.PivotTables("PivotTable1").PivotFields ( _
"Mittelwert von Cost per kW")
.NumberFormat = "#,##0.00 ""‚¬/kW"""
End With
End Sub

.... for the macro to work properly.

Regards

p.s.: Excel 2010 Beta

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...el.programming


All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com