Excel vba commands for multi language of excel

bosstec

New Member
Joined
Jun 23, 2011
Messages
12
I'm developing excel in english language and writing commands in english, which is not my main language. I'm located in Denmark.

My problem:
All my formulas in the excel sheet is originally written with english commands, like SUM, IF, OR ect.
When i open the workbook in another language og Excel, all the commands will change to this language and excel understand the formulas. So far so good.

But when i write formulas (commands) to cells from vba, they are in english, because i wrote them like that in vba, they are not working anymore - excel don't recognice the commands...!

How can i work around this problem?

reg Frank
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Maybe use the FormulaLocal property?
 
Upvote 0
I already have the FormulaLocal in front of the string i write to the cell (red marked). But it still write the english commands "IF", "OR" ect
Is there some problem with my code?


Private Sub Workbook_SheetChange(ByVal sh As Object, ByVal Target As Range)
ActiveSheet.Unprotect Password:="password"
Application.EnableEvents = False
Dim formula As String
If Not Application.Intersect(Target, Range("P8:P16,P19:P27,P30:P38,P41:P49,P52:P60,P63:P71,P74:P82")) Is Nothing Then
With Target.Offset(, 1)
If Target.Value = "Vagtudkald" Then
.Value = ""
.Interior.Color = RGB(255, 255, 0)
.Locked = False
.Validation.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="=Time24"
Else
.FormulaLocal = "=IF(OR(" & Target.Address(0, 0) & "="""";" & Target.Offset(-1, 2).Address(0, 0) & "="""");"""";" & Target.Offset(-1, 2).Address(0, 0) & ")"
.Interior.Color = RGB(217, 217, 217)
.Locked = True
.Validation.Delete
End If
End With
End If
Application.EnableEvents = True
ActiveSheet.Protect Password:="password"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,700
Members
452,938
Latest member
babeneker

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