LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default translating formulas

I am using the code below to translate worksheet formulas to the locale
language. For some formulas this works fine (e.g. SUM), but for others
it doesn't (e.g. MOD). Can anybody explain me why?? Using Excel XP.
Thanks for any responses.
Luc

********* start of sample code ******************

Public Sub Test_Successful()
ActiveSheet.Range("A1").Formula = TranslateFunction("=SUM(B1:B2)")
End Sub

Public Sub Test_Fails()
ActiveSheet.Range("A1").Formula = Translate("=MOD(ROW(),2)=0")
End Sub

Private Function Translate(funcUS As Variant, Optional wb As Workbook)
As Variant
Dim sheet As Worksheet
If wb Is Nothing Then
Set wb = ActiveWorkbook
End If
Set sheet = wb.Sheets.Add
sheet.Visible = False
sheet.Range("A1").Formula = funcUS
TranslateFunction = sheet.Range("A1").FormulaLocal
Application.DisplayAlerts = False
sheet.Delete
Application.DisplayAlerts = True
Set sheet = Nothing
End Function
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Translating Erika Excel Discussion (Misc queries) 0 June 6th 08 03:13 PM
translating lotus 123 formulas into excel Seth Excel Worksheet Functions 1 February 26th 07 08:11 PM
Translating formulas Cameron Excel Discussion (Misc queries) 9 August 3rd 06 11:43 AM
Translating spreadsheet formula to VBA Sheela[_2_] Excel Programming 8 June 6th 05 02:51 AM
Overflow when translating from C++ HELP!! hunting Excel Programming 6 April 24th 04 08:18 PM


All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"