Change Number to Arabic and back

A

Abdul

Hi,

I have set my regional settings to English(UK). Is it possible to
change the number format to Arabic(Saudi Arabia) and back to
English(UK) by code?

So that I will run a report using either of the number format.

Thanks

Abdul
 
N

NickHK

Abdul,
Something like this:

Private Sub CommandButton6_Click()

Const NUMFORMAT As String = "#0"

With Range("B9")
If .NumberFormat = "[$-2000401]" & NUMFORMAT Then
.NumberFormat = NUMFORMAT
Else
.NumberFormat = "[$-2000401]" & NUMFORMAT
End If
End With

End Sub

NickHK
 
A

Abdul

Thanks Nick

I am looking for a way to change the system Regional settings
temporarily.

I just want to change the Language to Arabic(Saudi Arabia) so that the
number format will also change and then back to English(UK)

By just changing the format in acell is not changing the digits to
Arabic way.

Thanks

Abdul

Abdul,
Something like this:

Private Sub CommandButton6_Click()

Const NUMFORMAT As String = "#0"

With Range("B9")
If .NumberFormat = "[$-2000401]" & NUMFORMAT Then
.NumberFormat = NUMFORMAT
Else
.NumberFormat = "[$-2000401]" & NUMFORMAT
End If
End With

End Sub

NickHK

Abdul said:
Hi,

I have set my regional settings to English(UK). Is it possible to
change the number format to Arabic(Saudi Arabia) and back to
English(UK) by code?

So that I will run a report using either of the number format.

Thanks

Abdul
 
N

NickHK

Abdul,
English Excel 2002 showed Arabic characters with that code, which I assumed
were numerals, but apparently I was wrong.

There is a previous thread in this NG about this, "Modify windows language
using VBA", but still requires user interaction.

NickHK

Abdul said:
Thanks Nick

I am looking for a way to change the system Regional settings
temporarily.

I just want to change the Language to Arabic(Saudi Arabia) so that the
number format will also change and then back to English(UK)

By just changing the format in acell is not changing the digits to
Arabic way.

Thanks

Abdul

Abdul,
Something like this:

Private Sub CommandButton6_Click()

Const NUMFORMAT As String = "#0"

With Range("B9")
If .NumberFormat = "[$-2000401]" & NUMFORMAT Then
.NumberFormat = NUMFORMAT
Else
.NumberFormat = "[$-2000401]" & NUMFORMAT
End If
End With

End Sub

NickHK

Abdul said:
Hi,

I have set my regional settings to English(UK). Is it possible to
change the number format to Arabic(Saudi Arabia) and back to
English(UK) by code?

So that I will run a report using either of the number format.

Thanks

Abdul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top