LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default The best way to build your own VBA library

Hi guys,

I was dabbling with the following great piece of code, courtesy of
Chip Pearson:

Sub DeleteSheets(SheetsToKeep As Variant, _
Optional WhichWorkbook As Workbook)
Dim WB As Workbook
Dim Arr() As String
Dim N As Long
Dim V As Variant

If WhichWorkbook Is Nothing Then
Set WB = ThisWorkbook
Else
Set WB = WhichWorkbook
End If
..
..
..

And I came across the following problem: since I put all my general
subroutines in the PERSONAL.xls workbook (so that they are easily
accessed from any other project), ThisWorkbook would be PERSONAL.xls,
no matter which was the workbook from which I called DeleteSheets. I
solved this by changing

Set WB = ThisWorkbook

into

Set WB = ActiveWorkbook

I think this is the only way, if I don't want to include the Sub
DeleteSheets into each workbook which uses it. Am I right? And more
importantly, how do you manage your own Excel VBA library? Do you
store all your modules inside PERSONAL.xls or is there a better way?
Thanks,

Best Regards

deltaquattro
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Build a Table jxbeeman Excel Discussion (Misc queries) 2 August 12th 09 11:19 PM
Build DateSeries (?) sgl Excel Programming 4 January 4th 08 12:40 PM
Reference Library - Missing Library in a lower version. luvgreen Excel Programming 1 October 7th 04 02:08 AM
How to build build a macro that automatically imports PedroPeso Excel Programming 1 December 26th 03 08:14 PM
Build Add-in in C++ Bura Tino Excel Programming 2 September 28th 03 03:34 AM


All times are GMT +1. The time now is 07:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"