+ Reply to Thread
Results 1 to 8 of 8

Copied values are in wrong format

  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Copied values are in wrong format

    Hello

    My problem is that i am copying values from one sheet like: 1355,588846 and 456,23589 and storing them in a array. When i want to display the array in another sheet the values come out like 1355588846 and 45623589.
    So in the first sheet excel recorgnises the comma as a decimal number and in the other sheet as a thousand seperator. How can i change this?

    My code is:
    Please Login or Register  to view this content.
    Best regards

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Copied values are in wrong format

    may be this would help:
    Please Login or Register  to view this content.
    PS. Are you sure that values stored in sheet Front are numbers - not text just looking like numbers?
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copied values are in wrong format

    Quote Originally Posted by Kaper View Post
    Please Login or Register  to view this content.
    Hey Kaper

    Unfortunately your command didnīt work. I can see that the cells where i take the numbers to store in the array is in the format "General".
    Last edited by RorschachDK; 04-07-2014 at 07:37 AM.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Copied values are in wrong format

    1) Despite cells are formatted as general, the value still can be text (not number).
    2) How is the StoreArray declared?
    3) What is the format of your destination cells

    4) See forum rule 12 in http://www.excelforum.com/forum-rule...rum-rules.html and edit your post.

  5. #5
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copied values are in wrong format

    2) The array is declared as a string.
    3) The format is number. I have tried changing them to general but same result

    Best regards

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Copied values are in wrong format

    So probably cause of your problem is here: "array is declared as a string".
    You are writing strings into cells. Why not using array of double? Or check and correct values (texts) in the array (for instance with replace function) to follow required format.
    Last edited by Kaper; 04-07-2014 at 11:03 AM.

  7. #7
    Registered User
    Join Date
    10-11-2013
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Copied values are in wrong format

    Thanks Kaper - Changing from String til Double did the trick.

    Regarding editing my earlier post - I did..now its just code, before it was the entire post

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Copied values are in wrong format

    OK.
    Sorry, not noted that.
    Probably even such part was not needed, but anyway, now it is not "quote whole posts", so I think it is OK.

    So if it is Solved - would be lovely if you mark a thread as solved. Again - description of the procedure is in rules.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Date format not being copied?
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2012, 07:46 AM
  2. wrong data copied into new cell from macro
    By johnmerlino in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2011, 10:42 AM
  3. Copied data will not format
    By Tim Peirce in forum Excel General
    Replies: 2
    Last Post: 12-22-2008, 03:55 PM
  4. Replies: 3
    Last Post: 08-11-2006, 09:10 AM
  5. [SOLVED] Can't change format of copied cells
    By xirx in forum Excel General
    Replies: 1
    Last Post: 05-12-2005, 05:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1