Extracting VBA from Excel to Word

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
21,894
Office Version
  1. 365
  2. 2019
  3. 2013
  4. 2007
Platform
  1. Windows
Hi All
I am after a macro that will
1. Open ALL files in a Directory, one at a time
2. Copy ALL of the VBA code
3. Paste ALL code from ALL workbooks to the one Word document

Sounded simple enough......

Any assistance would be greatly appreciated....by Boss is having a cow because I'm taking up too much space on the server !!!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Perhaps I am missing something ....
If you create a Word document are you going to just print it and not save it? If you do save it will that not reduce the space on the Server?
If the workbooks are not needed, why not just zip them and move them to a DVD or other storage device?
 
Upvote 0
Hi Derek
Removing a couple of hundred workbooks from the server and puting the code into a document will reduce space. I've done a number of them manually and it does save space.....and it's easier to find the code.
When I first started playing with VBA, it was 1 workbook for 1 code module....bad idea !!, but I didn't know any better at the time.
 
Upvote 0
What will you do when you need the code again?

Are you sure it's actually the code in these files that's taking up all the space?
 
Upvote 0
Hi Norie
As each Sub has a description / explanation on what it does, I'll copy and paste
I agree it's not the code taking up all the space it's the number of workbooks and I'm sure a lot of them have hundreds, maybe even thousands of rows of used "blank" area.

I'm open to suggestion to the best method of "archiving" all this stuff.

Actually, now that I think of it, it would have probably been a great thread in the lounge !!
 
Upvote 0
Michael

Why not archive it in Excel workbooks?

You could group relevant code/subs together and create individual workbooks for each group.

You could even set up some sort of simple folder structure where at the top level you have folders for each main category.

Within each folder are all the workbooks that belong to that category.

That might not cut down of the no of files as much as putting everything in one place, but it might help when trying to locate and copy/use the code.

All you need to do is find the workbook for the topic/category, open it than transfer the code to the workbook you need it for.

You could do that by just copying/pasting or dragging modules.

If that's too complicated/time-consuming, and it is starting to sound like it would be, you could just try the original workbook archive idea.:)
 
Upvote 0
Thanks Norie
Your input is appreciated.
Maybe I need to give this a little more thought, or as I said, post it to the Lounge and see what everybody else is doing !

Thanks again for your comments and suggestions.
 
Upvote 0
You could consider 'Answer Tool'. I used this to store various 'standard' replies to emails sent to a club website and also (using a different file/database name) as storage of VBA code snippets. Important to keep backups of the tool's database.
http://www.answertool.com/
You can search the database and set it to automatically copy selected entries to the clipboard for pasting elsewhere.
 
Upvote 0
Thanks Derek, I'll look at the site.
I'm starting to rethink my methodology of how to do this.
 
Upvote 0

Forum statistics

Threads
1,224,508
Messages
6,179,188
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top