![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: Pittsburgh, PA
Posts: 317
|
If I copy a worksheet using VBA, how can I delete all VBA code in it automatically.
__________________
Thanks in advance, Patrick |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Pittsburgh, PA
Posts: 317
|
Clarification.
I have a workbook. I am copying a sheet using VBA to a new workbook. I want to delete all of the VBA in this new workbook. How can I do so?
__________________
Thanks in advance, Patrick |
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Location: Cincinnati, OH
Posts: 4
|
Well it seems you're doing already what I've been trying to figure out how to do (Copy a worksheet from one file into another workbook). Would you be so kind as to tell me how to do this? Thanks!
Rob Hensley hensleyrob@nku.edu |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Apr 2002
Location: Pittsburgh, PA
Posts: 317
|
And I do not want to erase the code from the sheet the originally contained it. Just the copied one.
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Location: Pittsburgh, PA
Posts: 317
|
Zoid,
ActiveSheet.Copy This will copy a worksheet into a new workbook. |
|
|
|
|
|
#6 |
|
New Member
Join Date: May 2002
Location: Cincinnati, OH
Posts: 4
|
OK, I'd really appreciate it if someone could just give me the code to do this (I learn much better from reading code, and I need it for work so I don't have much time). Hopefully you can understand this.
What I have is four seperate workbooks (four different files: EAST, WEST, CENTRAL, OMG). Each one of those files consists of only one Sheet each. What I want to do is create a new workbook (LOG.xls), with four sheets, and be able to have a macro pull the data from WEST.xls and put it in Sheet1 of LOG.xls, pull the data from EAST.xls and put it in Sheet2 of LOG.xls, pull the data from CENTRAL.xls and put it in Sheet3 of LOG.xls, pull the data from OMG.xls and put it in Sheet4 of LOG.xls. And I'd like for all this to be done at the start when someone opens LOG.xls. Like I said, hopefully you understand what I'm asking for. So far I've spent quite a few hours racking my brain and reading examples that _should_ have helped me...but I got NO where! PLEASE, if someone could just give me the code to do this it'd be greatly appreciated, thanks! [ This Message was edited by: zoid on 2002-05-23 19:03 ] |
|
|
|
|
|
#7 |
|
New Member
Join Date: May 2002
Posts: 48
|
Why don't you try recording the macro which automatically gives you the code? Put Tools--->macros--->record new and just go through those steps you mentioned, then get your macro and choose --->step into and view the code. Hope this helped.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|