A
abdrums
The line that start with "Set cRange" (last line) in this code gave me a
Run-time error '438': Object doesn't support this property or method. Anybody
can help me? Will be appreaciated, thanks.
Set wsStandards = Workbooks.Open(Filename:=stFullName)
Set wsSystem = ThisWorkbook.Sheets(TextBox1.Text)
'Set wsStandards = Sheets("Standards")
wsSystem.Activate
nLastRow = wsSystem.Cells(nFirstRow, 2).End(xlDown).Row
nLastRow2 = wsSystem.Cells(nFirstRow, 2).End(xlDown).Row
vCompType = wsSystem.Range(wsSystem.Cells(nFirstRow, 2),
wsSystem.Cells(nLastRow, 2))
vStanType = wsSystem.Range(wsSystem.Cells(nFirstRow, 11),
wsSystem.Cells(nLastRow, 11))
For m = 1 To nLastRow + 1 - nFirstRow
If InStr(1, CStr(vStanType(m, 1)), "NC", vbTextCompare) = 0 Then
Set cRange = Nothing
Set cRange =
wsStandards.Columns("B").Find(What:=CStr(vCompType(m, 1)),
After:=wsStandards.Cells((nFirstRow - 1), 2), _
LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext, MatchCase:=False)
Run-time error '438': Object doesn't support this property or method. Anybody
can help me? Will be appreaciated, thanks.
Set wsStandards = Workbooks.Open(Filename:=stFullName)
Set wsSystem = ThisWorkbook.Sheets(TextBox1.Text)
'Set wsStandards = Sheets("Standards")
wsSystem.Activate
nLastRow = wsSystem.Cells(nFirstRow, 2).End(xlDown).Row
nLastRow2 = wsSystem.Cells(nFirstRow, 2).End(xlDown).Row
vCompType = wsSystem.Range(wsSystem.Cells(nFirstRow, 2),
wsSystem.Cells(nLastRow, 2))
vStanType = wsSystem.Range(wsSystem.Cells(nFirstRow, 11),
wsSystem.Cells(nLastRow, 11))
For m = 1 To nLastRow + 1 - nFirstRow
If InStr(1, CStr(vStanType(m, 1)), "NC", vbTextCompare) = 0 Then
Set cRange = Nothing
Set cRange =
wsStandards.Columns("B").Find(What:=CStr(vCompType(m, 1)),
After:=wsStandards.Cells((nFirstRow - 1), 2), _
LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext, MatchCase:=False)