Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem with Excel VBA script, decimal bug

Hi,

We have problem with a spreadsheet where we use VBA to move inputed data in
cells within a column to
a row. The inputed data looks like, 0,3446325533953 and
0,45324657652432 etc, when moved to the assigned row it only have 3
decimals and in this case the above figures will show 0,345 and 0,453 when
moved to the cells in the row. For
the most of the time this function works all right in the spreadsheet
template, but sometimes the format of the cells changes. It converts to hash
symbols (#####), and when moving
the cursor to the cell it instead of saying 0,345 (as for the example above)
it says 3446325533953,000. It looks like decimal format problem bug for me.
When
we run "detect and repair" excel solves the wrong output. But since "detect
and repair" takes long time to run we can't live with this in a production
manner.

We are are running an english version of office 2003 pro with sp2 on a
windows xp pro sp2 computer.

a sample of the VBA for the funtction to move inputed cell data looks like
this.

Private Sub CommandButton7_Click() 'Godkänd
Cells(15 + Cells(15, "J").value, "A").value = Cells(15, "J").value
Cells(15 + Cells(15, "J").value, "B").value = TextBox3
Cells(15 + Cells(15, "J").value, "C").value = CSng(TextBox1)
Cells(15 + Cells(15, "J").value, "D").value = CSng(TextBox2)
Cells(15 + Cells(15, "J").value, "E").value = CSng(TextBox4)
Cells(15 + Cells(15, "J").value, "F").value = CSng(TextBox5)
Cells(15 + Cells(15, "J").value, "G").value = CSng(TextBox6)
Cells(15 + Cells(15, "J").value, "H").value = CSng(TextBox2.value -
TextBox5.value)
End Sub

We look forward for any hints and proposals of solution.

Thanks,
//Richard

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default Problem with Excel VBA script, decimal bug

Hi
In your Regional Settings (through the Control Panel) have you set it
to your local language (Norwegian, Danish, Swedish?). This should
insure that "," is interpreted as a decimal seperator
(Norwegian/Swedish/Danish default) rather than a thousands seperator
(English default).
regards
Paul

Richard RE wrote:
Hi,

We have problem with a spreadsheet where we use VBA to move inputed data in
cells within a column to
a row. The inputed data looks like, 0,3446325533953 and
0,45324657652432 etc, when moved to the assigned row it only have 3
decimals and in this case the above figures will show 0,345 and 0,453 when
moved to the cells in the row. For
the most of the time this function works all right in the spreadsheet
template, but sometimes the format of the cells changes. It converts to hash
symbols (#####), and when moving
the cursor to the cell it instead of saying 0,345 (as for the example above)
it says 3446325533953,000. It looks like decimal format problem bug for me.
When
we run "detect and repair" excel solves the wrong output. But since "detect
and repair" takes long time to run we can't live with this in a production
manner.

We are are running an english version of office 2003 pro with sp2 on a
windows xp pro sp2 computer.

a sample of the VBA for the funtction to move inputed cell data looks like
this.

Private Sub CommandButton7_Click() 'Godkänd
Cells(15 + Cells(15, "J").value, "A").value = Cells(15, "J").value
Cells(15 + Cells(15, "J").value, "B").value = TextBox3
Cells(15 + Cells(15, "J").value, "C").value = CSng(TextBox1)
Cells(15 + Cells(15, "J").value, "D").value = CSng(TextBox2)
Cells(15 + Cells(15, "J").value, "E").value = CSng(TextBox4)
Cells(15 + Cells(15, "J").value, "F").value = CSng(TextBox5)
Cells(15 + Cells(15, "J").value, "G").value = CSng(TextBox6)
Cells(15 + Cells(15, "J").value, "H").value = CSng(TextBox2.value -
TextBox5.value)
End Sub

We look forward for any hints and proposals of solution.

Thanks,
//Richard


Reply
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
Script problem - Help please Les Stout[_2_] Excel Programming 5 October 30th 05 08:56 AM
Problem with printing from VB-script in Excel Jo Segers Excel Programming 2 January 28th 05 07:25 AM
Cutting off numbers to two decimal places using a SCRIPT tilt64 Excel Programming 2 August 5th 04 03:01 PM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM
different ver Excel - problem with decimal separator (for experts) Mark[_17_] Excel Programming 5 January 22nd 04 10:10 AM


All times are GMT +1. The time now is 01:28 PM.

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"