when open the excel and to do below VBA, And the VBA show there has some mistake, Please help check.
Sub Tianchong()
Dim i As String
Dim w As Worksheet, wb As Workbook, t As Worksheet
Set wb = Workbooks.Open("C:\Users\ZHEN YUAN\Desktop\vba\att.xlsx")
Set w = wb.Worksheets("Sheet1")
set t = worksheets("申请单")
t.Cells(7, 4) = wb.Cells(2, 5)
End Sub
I want sheet.cells = wb.sheet.cells(4,7). But the VBA show Did not find the sheet"申请单". Both excel as xlsx and only one sheet in workbook.
Thank You!!