G
Guest
I try to change the cell number format in my "add in" module using following
statement:
ActiveCell.NumberFormat = "0.00%"
But it does not change the the format, the cell number format was still
"General".
here is my whole code:
Option Explicit
Function numberformat_test()
ActiveCell.NumberFormat = "0.00%"
numberformat_pc_test = 0.234
End Function
1. This code is save in test.xla as a add in file;
2. In Excel, from Tools->Add-Ins, load test.xla;
3. From Excel: Insert->Functions->User Defined category select
numberformat_test function;
4. The cell supposes present 23.4%; but it displays 0.234.
Some friends kindly offered some solutions, but they are only callable in
Macro and should be only resident in local sheet. What I want is an add-in
xla file which can be called by any sheet.
Thanks.
statement:
ActiveCell.NumberFormat = "0.00%"
But it does not change the the format, the cell number format was still
"General".
here is my whole code:
Option Explicit
Function numberformat_test()
ActiveCell.NumberFormat = "0.00%"
numberformat_pc_test = 0.234
End Function
1. This code is save in test.xla as a add in file;
2. In Excel, from Tools->Add-Ins, load test.xla;
3. From Excel: Insert->Functions->User Defined category select
numberformat_test function;
4. The cell supposes present 23.4%; but it displays 0.234.
Some friends kindly offered some solutions, but they are only callable in
Macro and should be only resident in local sheet. What I want is an add-in
xla file which can be called by any sheet.
Thanks.