+ Reply to Thread
Results 1 to 3 of 3

VBA Code-csv file into excel- from general to text

  1. #1
    Registered User
    Join Date
    02-10-2018
    Location
    Poland
    MS-Off Ver
    2010
    Posts
    7

    VBA Code-csv file into excel- from general to text

    I have a “.csv” file. Now we would like to copy data from this file into another Excel file. Doing this with my simple macro, I encounter a problem in some columns as I have numbers which are stored there in the format: “0000” and “01234567890”. Pasting the data makes then a “0” or “E09” out of the former source.

    If I did that manually, I would do the following:

    1.Copy from .csv file
    2.Paste > “use text import wizard” > changing the respective fields (LFNR_... and EXTERNAL_ID) from “general” to “text”.
    3.Would be happy – everything looks fine

    This is current macro:


    Please Login or Register  to view this content.
    Do you know a trick how to paste csv-data into an excel spreadsheet keeping the data okay?
    Last edited by michelcr7; 02-10-2018 at 11:39 AM.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: VBA Code-csv file into excel- from general to text

    You could try
    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,759

    Re: VBA Code-csv file into excel- from general to text

    michelcr7 Please take the time to review our rules. There aren't many, and they are all important.

    Your post does not comply with Rule 8 of our Forum Rules: Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you must provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (most other forums have the same rule).

    This thread should have no further posts until links to the cross-posts are provided.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Need Code Modification for Text file to Excel File
    By pvsvprasad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2016, 12:55 PM
  2. Text is shown as General in excel 2010
    By abbassi in forum Excel General
    Replies: 5
    Last Post: 10-17-2014, 03:48 AM
  3. Difference in Excel file Properties - General and Details?
    By garveyarmy in forum Excel General
    Replies: 3
    Last Post: 03-21-2014, 09:35 AM
  4. VBA code for aligning excel file converted from text file.
    By anbub1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2013, 12:44 PM
  5. Code to Export Excel Data to Text File
    By ashkash in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-13-2012, 05:59 AM
  6. VBA code to import text file to the fixed excel file
    By wangdian in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-30-2010, 10:13 AM
  7. Format: General - Text - General
    By iturnrocks in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-11-2006, 11:50 AM

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