Hi all!
<o
> </o
>
I’m new to this forum and also VBA so be gentle!
<o
></o
>
<o
> </o
>
I have an excel sheet with a button linking to a form that gives input to a calculation done in the sheet.<o
></o
>
<o
> </o
>
One of the inputs in this form is ComboBox1. The source for this combobox is row AF1:AF13. This is formatted as a percentage i.e. 0 %, 5 %, 10 % and so on. In addition I’ve added the following code to the ComboBox:<o
></o
>
<o
> </o
>
Private Sub ComboBox1_Change()<o
></o
>
ComboBox1 = Format(ComboBox1, "##0 %")<o
></o
>
Range("C17") = ComboBox1.Value<o
></o
>
End Sub<o
></o
>
<o
> </o
>
This is my attempt at getting the correct formatting of the numbers in the form and in the excel sheet. However, I’m not getting the correct values in the form.<o
></o
>
<o
> </o
>
In the form when I select the value it’s displayed correctly, but not after selection. For example on selecting 10 % from the dropdown it’s displayed in the form as 0.10.<o
></o
>
<o
> </o
>
Other values again turn to a completely wrong number. For example selecting 20 % turns to 3655700 % in the form and the excel sheet.<o
></o
>
<o
> </o
>
Any tips from you guys would be appreciated!<o
></o
>
<o


I’m new to this forum and also VBA so be gentle!



<o


I have an excel sheet with a button linking to a form that gives input to a calculation done in the sheet.<o


<o


One of the inputs in this form is ComboBox1. The source for this combobox is row AF1:AF13. This is formatted as a percentage i.e. 0 %, 5 %, 10 % and so on. In addition I’ve added the following code to the ComboBox:<o


<o


Private Sub ComboBox1_Change()<o


ComboBox1 = Format(ComboBox1, "##0 %")<o


Range("C17") = ComboBox1.Value<o


End Sub<o


<o


This is my attempt at getting the correct formatting of the numbers in the form and in the excel sheet. However, I’m not getting the correct values in the form.<o


<o


In the form when I select the value it’s displayed correctly, but not after selection. For example on selecting 10 % from the dropdown it’s displayed in the form as 0.10.<o


<o


Other values again turn to a completely wrong number. For example selecting 20 % turns to 3655700 % in the form and the excel sheet.<o


<o


Any tips from you guys would be appreciated!<o

