Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel VBA ".value" / Strange Behaviour!!!

Using Excel 2002 and VB6.3

I type just four numbers 1, 8, 5 and 2. That is 1852 in A1.
NO FORMATS AT ALL. JUST FOUR NUMBERS.

A
-------------
1 | 1852 |
-------------

I use VBA Immediate Window to do the following

? Range("A1").Value
1852.00034359738 <<<< Load of crap.

and it returns some unnecessary numbers after the decimal point.

---

Using Excel 2000 and VB6.0

I do the same thing...

? Range("A1").Value
1852 <<< Works as expected

----

I am very much annoyed with this behaviour as I have to export lots of
these values to an access database and each of those values are garbled
after the decimal point.

Can someone please explain the reason for this strange behaviour?

This problem is strangely new to me as I haven't experienced this
before.

Is it 1) a bug in the version of excel or vba (or) 2) a configuration
thingy?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Excel VBA ".value" / Strange Behaviour!!!

With Excel 2002 (XP) SP3 and VBA 6.3 I can't replicate it.

If this happened normally we would know about it, so it sounds like there is
something quite wrong.

Can't imagine that this has anything to do with configuration. It's not a
bug that would have survived for so long without a fix.

I'm not sure where that leaves you. Anyone else have an idea before a
reinstall?

Robin Hammond
www.enhanceddatasystems.com

"ifiaz" wrote in message
oups.com...
Using Excel 2002 and VB6.3

I type just four numbers 1, 8, 5 and 2. That is 1852 in A1.
NO FORMATS AT ALL. JUST FOUR NUMBERS.

A
-------------
1 | 1852 |
-------------

I use VBA Immediate Window to do the following

? Range("A1").Value
1852.00034359738 <<<< Load of crap.

and it returns some unnecessary numbers after the decimal point.

---

Using Excel 2000 and VB6.0

I do the same thing...

? Range("A1").Value
1852 <<< Works as expected

----

I am very much annoyed with this behaviour as I have to export lots of
these values to an access database and each of those values are garbled
after the decimal point.

Can someone please explain the reason for this strange behaviour?

This problem is strangely new to me as I haven't experienced this
before.

Is it 1) a bug in the version of excel or vba (or) 2) a configuration
thingy?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 105
Default Excel VBA ".value" / Strange Behaviour!!!

ifiaz wrote:
Using Excel 2002 and VB6.3

I type just four numbers 1, 8, 5 and 2. That is 1852 in A1.
NO FORMATS AT ALL. JUST FOUR NUMBERS.

A
-------------
1 | 1852 |
-------------

I use VBA Immediate Window to do the following

? Range("A1").Value
1852.00034359738 <<<< Load of crap.

and it returns some unnecessary numbers after the decimal point.

---

Using Excel 2000 and VB6.0

I do the same thing...

? Range("A1").Value
1852 <<< Works as expected

----

I am very much annoyed with this behaviour as I have to export lots of
these values to an access database and each of those values are garbled
after the decimal point.

Can someone please explain the reason for this strange behaviour?

This problem is strangely new to me as I haven't experienced this
before.

Is it 1) a bug in the version of excel or vba (or) 2) a configuration
thingy?

--------------------------------------

Ignoring VBA for the moment, if you look at the cell on the spreadsheet what do
you see? If you format it to show you lots of decimal places?

Bill
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel VBA ".value" / Strange Behaviour!!!

Trust me. It is a new blank workbook and worksheet. I just type 4
numbers 1, 8, 5 and 2 without any formatting.

For your info, There are no decimal places even I deliberately format
it. I know what I am doing in excel, so be assured that the cell
contains just four numbers.


Following procedure prints 1852.00034359738 in the immediate window

---
Sub BugTest()

Range("A1").Value = 1852

Debug.Print Range("A1").Value

End Sub
---


So Is reinstall the only option?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Excel VBA ".value" / Strange Behaviour!!!

ifiaz,
Can't reproduce it in Excel 2000.

Have you tried the Detect and Repair ?

NickHK

"ifiaz" wrote in message
oups.com...
Trust me. It is a new blank workbook and worksheet. I just type 4
numbers 1, 8, 5 and 2 without any formatting.

For your info, There are no decimal places even I deliberately format
it. I know what I am doing in excel, so be assured that the cell
contains just four numbers.


Following procedure prints 1852.00034359738 in the immediate window

---
Sub BugTest()

Range("A1").Value = 1852

Debug.Print Range("A1").Value

End Sub
---


So Is reinstall the only option?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Excel VBA ".value" / Strange Behaviour!!!


NickHK wrote:
ifiaz,
Can't reproduce it in Excel 2000.

Have you tried the Detect and Repair ?

NickHK


I did Detech and Repair, same result.

I did a Reinstall, same result.

What should I do. Should I just uninstall office xp completely from the
system and start over again. Please advise.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Excel VBA ".value" / Strange Behaviour!!!

I did a complete UnInstall and a fresh install. Still it doesn't work.

I hope some experts out there suggest me how I may go about fixing this
problem.

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"Abnormal behaviour" data entry form JR Hester Excel Discussion (Misc queries) 5 January 4th 07 11:04 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Strange "FormatCells" behaviour Mike Hyndman Excel Worksheet Functions 0 October 23rd 05 05:30 PM
Behaviour of "Replace" Mike NG Excel Programming 4 July 13th 03 12:36 AM


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