I have this code that opens a another workbook and selects the worksheet.
Sheet one has the Employee Name, The Date and The Worksheets to Open and the hours worked
Sub openTimeSheet()
Dim OpenSheet As String
Dim wbTS As Workbook
Dim lRow As Long
Dim iCol As Integer
Dim NAME As String
NAME = Range("a14", "a14").Text
OpenSheet = Sheets("sheet1").Cells(17, 4).Value
Set wbTS = Workbooks.Open("C:\Documents and Settings\AMY C\Desktop\TIME SHEETS.xls")
wbTS.Sheets(OpenSheet).Select
lRow = Columns(1).Cells.Find(NAME, LookIn:=xlValues).Row
iCol = Rows(1).Cells.Find("h7", LookIn:=xlValues).Column
Cells(lRow, iCol).Select
End Sub
It opens everything fine
but stops at
lRow = Columns(1).Cells.Find(NAME, LookIn:=xlValues).Row
Anyone have any ideas on where I'm going wrong?
Sheet one has the Employee Name, The Date and The Worksheets to Open and the hours worked
Sub openTimeSheet()
Dim OpenSheet As String
Dim wbTS As Workbook
Dim lRow As Long
Dim iCol As Integer
Dim NAME As String
NAME = Range("a14", "a14").Text
OpenSheet = Sheets("sheet1").Cells(17, 4).Value
Set wbTS = Workbooks.Open("C:\Documents and Settings\AMY C\Desktop\TIME SHEETS.xls")
wbTS.Sheets(OpenSheet).Select
lRow = Columns(1).Cells.Find(NAME, LookIn:=xlValues).Row
iCol = Rows(1).Cells.Find("h7", LookIn:=xlValues).Column
Cells(lRow, iCol).Select
End Sub
It opens everything fine
but stops at
lRow = Columns(1).Cells.Find(NAME, LookIn:=xlValues).Row
Anyone have any ideas on where I'm going wrong?