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: 4
Default building a formula with non-US country setting

Hi,


The code below works for Integer cel.values, but not for broken values.

I think it has something to do with countrysettings, in Belgium we use
comma's to represent broken numbers.

In the debugger I see that VBA builds the formula like this:
=Int($i$1 * 3.2)
but Excel using my countrysettings expects this
=Int($i$1 * 3,2)
and gives a runtime error.


Public Sub gewicht()
Dim cel As Range, rng As Range

With ActiveSheet
Set rng = .Range(.Cells(2, 5), .Cells(33000, 5))
i = 2
For Each cel In rng
If cel.Value < "" Then
cel.Offset(0, 5).Formula = "=int($i$1 * " & cel.Value & ")"

End If
i = i + 1
Next
End With
End Sub


Any help appreciated

Ward
 
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
Can I have the right formula to list all my agencies under country Michel Excel Worksheet Functions 2 March 8th 10 06:13 PM
typing 'Up Country' ends up as Up Country' ? Martin ©¿©¬ @nohere.net Excel Discussion (Misc queries) 4 May 8th 09 06:32 PM
VBA formula building pm[_2_] Excel Programming 14 March 7th 06 03:10 AM
When building formula in excel, it would be very useful to have t. [email protected] Excel Programming 1 October 20th 04 12:07 PM
When building formula in excel, it would be very useful to have t. [email protected] Excel Programming 0 October 20th 04 11:09 AM


All times are GMT +1. The time now is 07:21 AM.

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

About Us

"It's about Microsoft Excel"