abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,429
- Office Version
- 2019
- 2010
- Platform
- Windows
hi, experts
I have dilemma I design code to copy data from userform to sheet based on sheet name first when I declare the variables wk1,wk2 as worksheets it gives me error mismatch in this line
this is a part of code
and when I change declaring worksheets to worksheet the code works , why?
I appreciate if anybody help me to understand what's the problem
I have dilemma I design code to copy data from userform to sheet based on sheet name first when I declare the variables wk1,wk2 as worksheets it gives me error mismatch in this line
Code:
Set wk2 = Sheets("NEW"
this is a part of code
VBA Code:
Dim lr1, lr2 As Integer
Dim wk1, wk2 As Worksheets
Set wk1 = Sheets("expirity")
Set wk2 = Sheets("NEW")
and when I change declaring worksheets to worksheet the code works , why?
I appreciate if anybody help me to understand what's the problem