View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_3_] Alan Beban[_3_] is offline
external usenet poster
 
Posts: 130
Default Subscript out of range error

Chris M. wrote:
Workbooks.Open Filename:=Vendors


Try Workbooks.Open Filename:="Vendors"

Alan Beban

I get an error message of "Error 9 Subscript out of
range" whenever I run through the following code:

Private Sub ImportData()
'On Error Resume Next
Dim MasterSheet As String, Cell As Range
If UCase(InputBox("Please enter coordinator password to
continue...", "Fox and Jacobs Homes")) < "BUGSY1" Then
Exit Sub
MasterSheet = "MasterValidData"
Application.ScreenUpdating = False
Sheets("MasterValidData").Visible = True
Sheets("MasterValidData").Select
Cells.Delete
Cells.Delete Shift:=xlUp
Cells.Delete Shift:=xlUp

Workbooks.Open Filename:=Vendors
ActiveSheet.Range("A1").CurrentRegion.Copy
Workbooks("VPOUpdateFile").Sheets(MasterSheet).Ran ge
("B1").Paste

I'm not too sure what the issue is. Help is greatly
appreciated.