+ Reply to Thread
Results 1 to 8 of 8

Export values range to new spreadsheet

  1. #1
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Export values range to new spreadsheet

    Hi there,

    I want a certain range to be exported to a new spreadheet with a macro (the range can be fixed range OR can be selected)

    I have the following,and does work, but the problem is many of the values I am exporting are vlookup values, and then when exporting, it export the vlookup string instead of the value in the cell.
    How can I export only the values to a new spreadsheet?

    Here is what I have:

    Please Login or Register  to view this content.
    Thank you so long,

    Jakes
    Last edited by Jakes; 01-27-2012 at 05:38 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Export values range to new spreadsheet

    Use a paste special values instead of a paste.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Export values range to new spreadsheet

    Thank you for the reply,
    I have changed ActiveSheet.Paste to ActiveSheet.PasteSpecial, and it does the same as before, except now I also get an error "Cannot access read-only document Issue Register.csv"

  4. #4
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Export values range to new spreadsheet

    Thank you for the reply,
    I have changed ActiveSheet.Paste to ActiveSheet.PasteSpecial, and it does the same as before, except now I also get an error "Cannot access read-only document Issue Register.csv"

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Export values range to new spreadsheet

    Use
    Please Login or Register  to view this content.
    I fail to understand why its saving your file as read-only.

  6. #6
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Export values range to new spreadsheet

    Hi Arlu,

    Thank you, I have replaced the ActiveSheet.PasteSpecial with your code, and get the error Application defined or object defined error. When debugging, it takes me to your code. Any idea why?

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Export values range to new spreadsheet

    I tried your code and changed my earlier code line to this -
    Please Login or Register  to view this content.
    it works fine from beginning to end.

  8. #8
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: Export values range to new spreadsheet

    Thank you that did the trick!

+ 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