wondering if any one could help me with a macro that would export a sheet from active work book to new excel work book. It would be great if it copied over with values only.
wondering if any one could help me with a macro that would export a sheet from active work book to new excel work book. It would be great if it copied over with values only.
You could try and record you own macro.
here's a a sample
Found with Goggle, it's not that difficult, you should try itPlease Login or Register to view this content.
---
Hans
"IT" Always crosses your path!
May the (vba) code be with you... if it isn't; start debugging!
If you like my answer, Click the * below to say thank-you
The bold part of the text code fails. I am having trouble saving it to my desk top as tab name which is SM wTX Summary. Can any one help me make this happen?
C:\Users\Kozar\Desktop
Can you make it not specific so when this is shared it will save to the others desk top?
Please Login or Register to view this content.
[code]
Sub ExportSummary()
'~~> Change Sheet1 to the relevant sheet
'~~> This will create a new workbook with the relevant sheet
ThisWorkbook.Sheets("SM wTX Summary").Copy
'~~> Save the new workbook
ActiveWorkbook.SaveAs ENVIRON$("USERPROFILE") & \Desktop\SM wTX Summary.xlsx", FileFormat:=51
End Sub
I am really close now but the Users\Kozar\ needs to be universal so there computers will work when it is saved through the macro.
Any help is greatly appreciated
Please Login or Register to view this content.
I am really close now but the Users\Kozar\ needs to be universal so there computers will work when it is saved through the macro.
Any help is greatly appreciated
Please Login or Register to view this content.
The user Kozar is only accessible by the user named Kozar. So if somebody else logs in then .... the user name is 'somebody else'
The ENVIRON$ steeing takes the current usernama so it will alwasy work
Readup on environment settings,
open a command prompt and type SET < Enter > and you'll see them
I understand that
I have tried to insert the ENVIRON$("USERPROFILE") and cant get it to work with out errors and cant
How would you adjust this code to make it work.
Please Login or Register to view this content.
I put the code i my answer with the red text there was a " missing but you could have figured that out!
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks