Hi Biz,
As Dr's sounds like the ticket, just to
hopefully correct my previous...
[vba]
Option Explicit
Dim ShtNames_Missing
Sub Test()
Dim myWorkbookName As String
Dim aryShNames
Dim aryShNamesRange
Dim i As Long
myWorkbookName = ThisWorkbook.Name '"test.xls"
With ThisWorkbook.Worksheets("Sort Order")
aryShNamesRange = Application.WorksheetFunction _
.Transpose(.Range("A1:A" & .Cells(Rows.Count, 1).End(xlUp).Row).Value)
End With
ReDim aryShNames(1 To 1)
For i = LBound(aryShNamesRange) To UBound(aryShNamesRange)
If Not aryShNamesRange(i) = vbNullString Then
aryShNames(UBound(aryShNames)) = aryShNamesRange(i)
ReDim Preserve aryShNames(1 To (UBound(aryShNames) + 1))
End If
Next
ReDim Preserve aryShNames(1 To (UBound(aryShNames) - 1))
If Not SheetExists(aryShNames, myWorkbookName) Then
MsgBox "Missing Sheets:" & ShtNames_Missing
ShtNames_Missing = vbNullString
Else
MsgBox "do stuff here"
End If
End Sub
Function SheetExists(ByVal i_SheetName As Variant, _
Optional i_WorkbookName As String) As Boolean
Dim myWorkbook As Workbook
Dim i As Long
On Error Resume Next
If i_WorkbookName = "" Then
Set myWorkbook = ActiveWorkbook
Else
Set myWorkbook = Workbooks(i_WorkbookName)
If myWorkbook Is Nothing Then Exit Function
End If
SheetExists = True
For i = LBound(i_SheetName) To UBound(i_SheetName)
If myWorkbook.Sheets(i_SheetName(i)) Is Nothing Then
ShtNames_Missing = ShtNames_Missing & vbCrLf & i_SheetName(i)
SheetExists = False
End If
Next
On Error GoTo 0
End Function
[/vba]
I don't really have any suggestions as to books/courses. What I have been able to pick up is mostly through here, as well as a buddy who is awfully bright and of course searching the web. I find vbaexpress, or that is the folks here, just super helpful.
Have a great day
Mark