Hi.
Need help with rowcount value that I want to add on specific cells. For example if the text in column B starting from a specific place, finding "car, cat or horse" I want it to go on the same row, A column and write the next value. So it will be 1, 2, 3, 4, 5 and so on.
But it seems like that it wont write the value of "Cells(rowcounts + 1, 1).Value". Nothing happens. Why?
Please see below.
Dim rowcount10 As Integer
Dim rowcount11 As Integer
Dim rowcount12 As integer
rowcount10 = Cells(Rows.Count, 1).End(xlUp).Row
rowcount11 = Cells(Rows.Count, 2).End(xlUp).Row
For I = rowcount10 To rowcount11
rowcount12 = Cells(Rows.Count, 1).End(xlUp).Row
Cells(I + 1, 2).Select
If InStr(1, Range("B" & I + 1), "Car") Or InStr(1, Range("B" & I + 1), "Cat") Or InStr(1, Range("B" & I + 1), "Horse") Then
Cells(I + 1, 1).Value = Cells(rowcounts + 1, 1).Value
End If
Next I
Need help with rowcount value that I want to add on specific cells. For example if the text in column B starting from a specific place, finding "car, cat or horse" I want it to go on the same row, A column and write the next value. So it will be 1, 2, 3, 4, 5 and so on.
But it seems like that it wont write the value of "Cells(rowcounts + 1, 1).Value". Nothing happens. Why?
Please see below.
Dim rowcount10 As Integer
Dim rowcount11 As Integer
Dim rowcount12 As integer
rowcount10 = Cells(Rows.Count, 1).End(xlUp).Row
rowcount11 = Cells(Rows.Count, 2).End(xlUp).Row
For I = rowcount10 To rowcount11
rowcount12 = Cells(Rows.Count, 1).End(xlUp).Row
Cells(I + 1, 2).Select
If InStr(1, Range("B" & I + 1), "Car") Or InStr(1, Range("B" & I + 1), "Cat") Or InStr(1, Range("B" & I + 1), "Horse") Then
Cells(I + 1, 1).Value = Cells(rowcounts + 1, 1).Value
End If
Next I