Rich (BB code):
Sub ShowDeltaCalcWork(UpdatedPartArray() As Variant, CMBook As Workbook, zsdprcbook As Workbook)
Dim showwk As Worksheet
Dim bfilesheet As Worksheet
Dim commcalc As Worksheet
Dim bfrng As Range
Dim bfrows As Integer
Set showwk = CMBook.Sheets("PartCalc")
Set bfilesheet = CMBook.Sheets("Bfile_data")
Set commcalc = CMBook.Sheets("Bfile calculation")
MsgBox bfilesheet.Cells(Rows.Count, 1).End(xlUp).Row <--- this works, displays the correct value (49,000 or so)
bfrows = bfilesheet.Cells(Rows.Count, 1).End(xlUp).Row
MsgBox bfilesheet.Cells(Rows.Count, 1).End(xlUp).Row <--- this never appears, nothing after it runs, tried replacing it with bfrows
With bfilesheet
Set bfrng = .Range(.Cells(1, 1), .Cells(bfrows, 7))
End With
...insert a bunch of other code below
The macro goes on to the other subroutines to create pivot tables based on other data. I really can't understand why this subroutine would quit without giving any errors. Any ideas?