Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default simple problem with values in cells

Hi all,
I use the following code to fill some values into cells

Range("CA6").Select
Range("CA6") = "3.2745"
Range("CA7").Select
Range("CA7") = "8.9355"
Range("CA8").Select
Range("CA8") = "8.9355"
Range("CA9").Select
Range("CA9") = "13.875"
Range("CA10").Select
Range("CA10") = "4.440"
Range("CA11").Select
Range("CA11") = "6.660"
-and more code-

everything works, but in cell CA6 I get 32745 and in cell CA7 I get 89355
:-(
The CA8 values is 8,9355 - what 's right :-)
The format of all cells are the same.

What can I do to geet also the both values in CA6 and CA7 in the right way ?

When I let a macro with specialy this part of code separatly it will works
?!?!

I use WINN XXP and XL2000 with SP3

Thanks for help ... joachim


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default simple problem with values in cells

There is no obvious problem with the code, except it could be more efficient
by assigning the values directly.
for example......

Range("CA6").Value = "3.2745"
Range("CA7").Value = "8.9355"

This must be a format problem with the cells involved, suggest you set the
format of each cell individually to the required format eg numeric with 4
decimal places. I assume of course you are using a period as a decimal
separator not a comma ?

Cheers
Nigel



"Joachim" wrote in message
...
Hi all,
I use the following code to fill some values into cells

Range("CA6").Select
Range("CA6") = "3.2745"
Range("CA7").Select
Range("CA7") = "8.9355"
Range("CA8").Select
Range("CA8") = "8.9355"
Range("CA9").Select
Range("CA9") = "13.875"
Range("CA10").Select
Range("CA10") = "4.440"
Range("CA11").Select
Range("CA11") = "6.660"
-and more code-

everything works, but in cell CA6 I get 32745 and in cell CA7 I get 89355
:-(
The CA8 values is 8,9355 - what 's right :-)
The format of all cells are the same.

What can I do to geet also the both values in CA6 and CA7 in the right way

?

When I let a macro with specialy this part of code separatly it will works
?!?!

I use WINN XXP and XL2000 with SP3

Thanks for help ... joachim




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default simple problem with values in cells

Joachim

When I tried you code in a brand new sheet all values were entered and
displayed as expected.

Suggest you try this code also in a new book and see if you get the
same results

Also to speed up your code and to shorten the amount of typing you do
you might want remove your code that selects each cell before entering
data into it so your code reads as this

Range("a6").Value = "3.2745"
Range("a7") .Value= "8.9355"
Range("a8").value= "8.9355"

etc


---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default simple problem with values in cells

don't use double quotes:

Range("CA6") = 3.2745
Range("CA7") = 8.9355
Range("CA8") = 8.9355
Range("CA9") = 13.875
Range("CA10") = 4.440
Range("CA11") = 6.660

--
Regards,
Tom Ogilvy


"Joachim" wrote in message
...
Hi all,
I use the following code to fill some values into cells

Range("CA6").Select
Range("CA6") = "3.2745"
Range("CA7").Select
Range("CA7") = "8.9355"
Range("CA8").Select
Range("CA8") = "8.9355"
Range("CA9").Select
Range("CA9") = "13.875"
Range("CA10").Select
Range("CA10") = "4.440"
Range("CA11").Select
Range("CA11") = "6.660"
-and more code-

everything works, but in cell CA6 I get 32745 and in cell CA7 I get 89355
:-(
The CA8 values is 8,9355 - what 's right :-)
The format of all cells are the same.

What can I do to geet also the both values in CA6 and CA7 in the right way

?

When I let a macro with specialy this part of code separatly it will works
?!?!

I use WINN XXP and XL2000 with SP3

Thanks for help ... joachim




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
Simple IF problem Trevor Aiston[_2_] Excel Worksheet Functions 0 September 12th 09 03:18 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple problem? Foobi Excel Worksheet Functions 3 February 10th 06 10:24 PM
Need help with a simple problem Gary[_13_] Excel Programming 2 January 3rd 04 01:58 PM
Another simple little problem Jerry[_14_] Excel Programming 1 November 3rd 03 03:00 AM


All times are GMT +1. The time now is 11:41 AM.

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"