D
Dan
Below is a sub routine that worked great on my machine but when I gave it to
a user, I would get a subscript out or range error. This was due to not
having the .xls extension in the wbname variable or in the windows ( )
activate piece of the code. When calling a file does it always need the
..xls extension?
Sub See_Vendor()
x = ActiveWorkbook.Name
wbname = "Current Vendors.xls" <<<<<<<<<<<<=========
Call WorkbookIsOpen(wbname)
If Err <> 0 Then
Workbooks.Open Filename:="s:\finance\acct-gl\current vendors.xls"
End If
Windows("current vendors.xls").Activate <<<<<<<<<<<<<============
For Each n In ActiveWorkbook.Names
n.Delete
Next n
Range("a2").Select
Top = ActiveCell.Address
Selection.End(xlDown).Select
ActiveCell.Offset(0, 3).Select
bottom = ActiveCell.Address
Worksheets("Sheet1").Range(Top, bottom).Name = "Vendor"
Load Vendor_Lookup
Windows(x).Activate
Vendor_Lookup.Show
End Sub
a user, I would get a subscript out or range error. This was due to not
having the .xls extension in the wbname variable or in the windows ( )
activate piece of the code. When calling a file does it always need the
..xls extension?
Sub See_Vendor()
x = ActiveWorkbook.Name
wbname = "Current Vendors.xls" <<<<<<<<<<<<=========
Call WorkbookIsOpen(wbname)
If Err <> 0 Then
Workbooks.Open Filename:="s:\finance\acct-gl\current vendors.xls"
End If
Windows("current vendors.xls").Activate <<<<<<<<<<<<<============
For Each n In ActiveWorkbook.Names
n.Delete
Next n
Range("a2").Select
Top = ActiveCell.Address
Selection.End(xlDown).Select
ActiveCell.Offset(0, 3).Select
bottom = ActiveCell.Address
Worksheets("Sheet1").Range(Top, bottom).Name = "Vendor"
Load Vendor_Lookup
Windows(x).Activate
Vendor_Lookup.Show
End Sub