+ Reply to Thread
Results 1 to 7 of 7

Copy & Paste Values, then export to CSV file

  1. #1
    Registered User
    Join Date
    10-03-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    25

    Copy & Paste Values, then export to CSV file

    Please Login or Register  to view this content.
    Hi, the code above works fine, but I need to adapt it to suit my needs.


    First of all, I need to copy I3:lastmemberinI3, L3:lastmemberinI3, X3:lastmemberinX3 (they will all have the same amount of rows from each column).

    I then need to paste the values only into the new workbook (which will be used to save as a csv file).

    The CSV file needs to be saved as the same name as the spreadsheet the data was first copied from.

    Thanks in advance!

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Copy & Paste Values, then export to CSV file

    Hi,

    does this work?
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-03-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Copy & Paste Values, then export to CSV file

    Yes, thankyou, this works really well, apart from after all of the data lots of commas follow it, would this have anything to do with formulas been in the cells, even though they have no value displaying? the formulas are:

    =IF(M21="","",A21& " " &K21)

    =IF(W23="","",IF(OR(M23="SOUNDER (INTERNAL)",M23="SOUNDER (EXTERNAL IP65)", M23="SOUNDER (EXTERNAL EEXD)"),"N/A",D23&H23&" "&F23&" "&W23&" "&V23))

    Also, do you have any idea how to name the exported file the same name as the spreadsheet name.

    Thanks for you help
    Last edited by j9070749; 12-13-2012 at 11:19 AM. Reason: Tried to make more clear

  4. #4
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Copy & Paste Values, then export to CSV file

    Oh sorry, I forgot that. You mean the worksheet name or the workbook name? Choose it in the code!
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-03-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Copy & Paste Values, then export to CSV file

    Thank you, the naming convention worked excellent!

    I still have the problem of the blank fields (I edited my last post so I'm unsure if you saw it), so the csv file reads something like this(example data)
    row1,row2,row3
    row1,row2,row3
    row1,row2,row3
    ,,
    ,,
    ,,
    ,,

    As I said, I'm sure its becuase of the forumlas in the cells, even though it isnt displaying any data, are you able to help me with

  6. #6
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Copy & Paste Values, then export to CSV file

    Here's the modified macro, I hope it works.
    Please Login or Register  to view this content.
    ps. I'm off soon so expect a reply tomorrow.

  7. #7
    Registered User
    Join Date
    10-03-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Copy & Paste Values, then export to CSV file

    This worked perfect. Thank you very much for the help.

+ 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