epactheactor
New Member
- Joined
- Sep 9, 2015
- Messages
- 38
Hello,
I'm attempting to use a find function in my code. Yet, when I run it, it puts the value of the cell into the variable and not the range.
Could someone please tell me what i am doing wrong?
Sub Saving_Crack()
Dim IDnum As String
Dim filePath As String
Dim crackIDnum As Range
Dim wt As Variant
Dim crackIDwkbk As String
Dim a As Range
'to get the ID number
crackIDwkbk = ActiveWorkbook.Name
Sheets("Properties").Activate
IDnum = Range("B2").Value
'go to masterlist
Windows("Check Defect Data Inputs").Activate
Set crackIDnum = Range("B1:B123").Find(IDnum)
Debug.Print crackIDnum
'flaw label as a variable
Range(crackIDnum).Offset(0, 15).Value = wt
End Sub
I'm attempting to use a find function in my code. Yet, when I run it, it puts the value of the cell into the variable and not the range.
Could someone please tell me what i am doing wrong?
Code:
Sub Saving_Crack()
Dim IDnum As String
Dim filePath As String
Dim crackIDnum As Range
Dim wt As Variant
Dim crackIDwkbk As String
Dim a As Range
'to get the ID number
crackIDwkbk = ActiveWorkbook.Name
Sheets("Properties").Activate
IDnum = Range("B2").Value
'go to masterlist
Windows("Check Defect Data Inputs").Activate
Set crackIDnum = Range("B1:B123").Find(IDnum)
Debug.Print crackIDnum
'flaw label as a variable
Range(crackIDnum).Offset(0, 15).Value = wt
End Sub
Code: