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: 17
Default Error setting number format

But only in Switzerland!!!

I am using the following code to set the NumberFormat of some cells in a
macro on my machine here in the U.S.:

If sColumn(i) = "L" Or sColumn(i) = "M" Then
DestCell = sColumn(i) & LTrim$(Str$(lWIPRow))
Range(DestCell).NumberFormat = myNumberFormat
End If

DestCell ends up being something like "L11" and myNumberFormat was picked up
from a cell where there was a valid Date-style numberformat.

When my colleague runs the exact same code in Switzerland, he gets a runtime
error '1004': Unable to set NumberFormat property of the Range class.

For him, DestCell ends up being something like "L11" and myNumberFormat was
picked up from a cell where there was a valid Date-style numberformat, though
in his regional style for dates.

The only other thing we can think of is he has Office 2002 and I have Office
2003. He wrote the original code and sent it to me and I simply added the
instructions shown above, so the rest of the code runs correctly on both
machines.
 
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
number format in regional setting vista not carried in excel2007 bsm Excel Discussion (Misc queries) 1 March 2nd 10 09:21 AM
Setting Error #VALUE,#REF,#NAME, etc. Gulfman100 New Users to Excel 6 February 11th 09 01:33 AM
Setting Cell Number Format With A Worksheet Function [email protected] Excel Worksheet Functions 1 December 16th 05 07:37 PM
Number format based on number format of another cell in another workbook Rob Excel Programming 9 January 9th 05 04:30 PM
Setting number format on range of cells Neils Christoffersen Excel Programming 2 November 19th 04 10:20 PM


All times are GMT +1. The time now is 08:12 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"