Forum Discussion
hrh_dash
Aug 07, 2022Iron Contributor
Pop up error: run time error 438 object doesn't support this property or method
Pop up error: "run time error 438 object doesn't support this property or method" when finding the first row and the last row containing specific text as for in this case would be "DC2". I would ...
- Aug 07, 2022
hrh_dash
Aug 18, 2022Iron Contributor
, it would be cells which contains DC2 with other text
HansVogelaar
Aug 18, 2022MVP
Dim DestDC2 As Range
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim adr As String
Dim sumDC2 As Double
Set ws1 = Sheet1
Set ws2 = Sheet2
Set DestDC2 = ws2.Cells.Find(What:="DC2", LookAt:=xlPart)
If Not DestDC2 Is Nothing Then
adr = DestDC2.Address
Do
sumDC2 = sumDC2 + DestDC2.Offset(0, 1).Value
Set DestDC2 = ws2.Cells.Find(What:="DC2", After:=DestDC2, LookAt:=xlPart)
If DestDC2 Is Nothing Then Exit Sub
Loop Until DestDC2.Address = adr
End If
ws1.Range("A1") = sumDC2
- hrh_dashSep 07, 2022Iron Contributor,thank you! the code works perfectly what i wanted. Thanks for the assistance