Hello people I have made following code but It was a time ago...
I get error: Runtime error 13 : incompatible types
see code below
when I see troubleshoots the problem the error is:
myTot = Round(DivAB / mycellRes)
Could someone help me ?
Thank you in advance
I get error: Runtime error 13 : incompatible types
see code below
Code:
Sub CheckIND()
'IND=IND CHECK FIL;;;;;;;;;;;;;;;;;;;;;;
For I = 2 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).row
If Cells(I, "J") = "IND" And Cells(I, "K") = "IND" And Len(Cells(I, "B")) <> 0 And Cells(I, "AB") <> 0 Then
Cells(I, 1).EntireRow.Interior.ColorIndex = 6
mycell = Cells(I, "B").Text
mycellRes = mycell - 1
DivAB = Cells(I, "AB").Text
myTot = Round(DivAB / mycellRes)
ValueSought = Cells(I, "A").Value
Set FirstInstance = Columns("A").Find(what:=ValueSought, LookIn:=xlFormulas, LookAt:=xlWhole, SearchFormat:=False)
If Not FirstInstance Is Nothing Then Set RangeToSearch = Range(FirstInstance, Cells.SpecialCells(xlCellTypeLastCell)).Columns(1)
RangeToSearchFirstRow = FirstInstance.row
RangeToSearchValues = RangeToSearch.Value
Set RangeToUpdate = FirstInstance
For j = 1 To UBound(RangeToSearchValues)
If RangeToSearchValues(j, 1) = ValueSought Then
Set RangeToUpdate = Union(RangeToUpdate, Cells(j - 1 + RangeToSearchFirstRow, "A"))
End If
Next j
RangeToUpdate.Offset(, 19).Value = myTot
End If
Next I
End Sub
when I see troubleshoots the problem the error is:
myTot = Round(DivAB / mycellRes)
Could someone help me ?
Thank you in advance