1. Why aren't you a fan of Personal workbooks? Do you mean this just for yourself or in my situation? It seems like this is the right path for me, but maybe I'm not seeing something that you are.
Just personal choice. I've seen problems reported about not being able to hide PWBs and it does kind of lock the toolkit to your user ID. That means that, when you are on holiday, or sick, the toolkit isn't readily available for anyone else to use. I also find it easier to develop and test code in a free standing workbook. Even though I can code from scratch, I still "record and tweak" in a lot of situations.
2. When you mean an "object variable", do you mean like a name of a range in Excel or something a bit more "VBA-programming-like"?
Yes, an object variable refers to a workbook, worksheet, range, cell, or whatever, amongst other things. So, for example, ...
Dim wbM As Workbook
' a currently open workbook
Set wbM = Workbooks("Master.xlsx")
' a variable to refer to a worksheet
Dim ws As Worksheet
For Each ws In wbM.Worksheets
' print the worksheet name
Debug.Print ws.Name
Next 'ws
' destroy the object variables
Set ws = Nothing
Set wbM = Nothing
3. I think I can name the range in my "Master" file and, if they go along for distribution, that's OK, but irrelevant to recipients. Am I on the right track?
Sure: a named range isn't necessarily a source for concern. But you can always hide Named Ranges, if you wish.
Dim wbM As Workbook
' a currently open workbook
Set wbM = Workbooks("Master.xlsx")
Dim n As Name
For Each n In wbM.Names
n.Visible = False
Next 'n
If you only want people to see the data in the worksheet(s), have you thought of saving it/them as .pdf files?
Using Named Ranges is always preferable to using hard coded ranges, as they will remain true even if rows are added or deleted, and if columns are added or deleted. You would need to create them as Dynamic Named Ranges in order to cope with an increasing or decreasing row count. For example:
Formula:
='1'!$A$2:INDEX('1'!$A:$A, COUNTA('1'!$A:$A))
Note, '1' is the sheet name.
Good luck
Bookmarks