Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I am having problems with my project. I'm unable to figure out why I keep getting a "Subscript out of range" error with the line highlighted in red below ...
The value for qfile is correct.
The workbook having the same value as qfile is open.
Is anyone able to shed any light on perhaps why I am receiving this error?
Rich (BB code):
Public wb_data As Workbook
Sub clean_up_database()
Dim norec As Long 'number of records
Dim sarah As Long
Dim myVal As Variant
Set wb_main = Workbooks("Sports15b.xlsm")
Set ws_vh = wb_main.Worksheets("VAR_HOLD")
Set ws_th = wb_main.Worksheets("TEMP_HOLD")
Set ws_rd = wb_main.Worksheets("Rental_Data")
Set ws_fac = wb_main.Worksheets("Facilities")
Set ws_front = wb_main.Worksheets("DYNAMIC")
Set fac1 = ws_fac.Range("A:H")
Set class1 = ws_fac.Range("B:B")
qfile = ws_vh.Range("B3") & ".xlsx"
Set wb_data = Workbooks(qfile)
The value for qfile is correct.
The workbook having the same value as qfile is open.
Is anyone able to shed any light on perhaps why I am receiving this error?