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:
Thank you so long,Sub IssueRegister_Rectangle6_Click() ' ' export Macro Range("C9:L60").Select Selection.Copy Workbooks.Add ActiveSheet.Paste ActiveWorkbook.SaveAs Filename:= _ "C:\Documents and Settings\Issue Register.csv" _ , FileFormat:=xlCSV, CreateBackup:=False Application.DisplayAlerts = False ActiveWorkbook.Close Application.DisplayAlerts = True End Sub
Jakes
Last edited by Jakes; 01-27-2012 at 04:38 AM.
Use a paste special values instead of a paste.
Cheers,
Arlette
If I 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]
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"
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"
UseI fail to understand why its saving your file as read-only.Activesheet.Pastespecial paste:=xlvalues
Cheers,
Arlette
If I 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]
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?
I tried your code and changed my earlier code line to this -it works fine from beginning to end.Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False
Cheers,
Arlette
If I 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]
Thank you that did the trick!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks