+ Reply to Thread
Results 1 to 4 of 4

Numerical values in a text format

  1. #1
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Numerical values in a text format

    Hi,

    I am having a problem with a tool I have made for occ sick.

    To summarise you key in the emp number dates reasons, actions etc and it initially has a change script that displays the proposed output details in both the database codes and the descriptions the user would see.

    E.g.

    Cancer = 0100

    In the display area it brings this through with the header 0 but knocks off the end 0

    E.g.

    010

    The other field I have like this is action type

    E.g. Sick note recieved = 001

    This is just pulling through as 1, even the code is exactly the same and all the formating is the same.

    This is then copied to the output tab where it is stored till all the entries are keyed, the next step is to turn the output file in to CSV.

    When you run the create csv macro and view the csv file produced you can see it has removed the header 0 as well!

    So in short, the spreadsheet macro is knocking off end 0 and the csv macro is knocking off the header 0.

    This is my code for the change event which is what copies and looks up the values for the display area:

    Please Login or Register  to view this content.

    This is the code I have slightly altered for my workbook, which Jerry BeauCaire wrote that creates my CSV file:


    Please Login or Register  to view this content.
    Last edited by mcinnes01; 10-28-2010 at 07:37 AM.

  2. #2
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Numerical values in a text format

    Ok so the first problem I have fixed, the update macro is pulling through the codes and maintaining their values.

    The problem is that the CSV file output is droping the header zero still, any ideas?

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Numerical values in a text format

    How are you testing the CSV file? Opening it in Excel again or in Notepad? The former will likely try and convert anything that looks like a number into a number.
    Remember what the dormouse said
    Feed your head

  4. #4
    Forum Contributor mcinnes01's Avatar
    Join Date
    05-25-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    449

    Re: Numerical values in a text format

    If I open it as a text file the format is correct.

    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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