hi,
this following algorithm is in my excel, i would like have a VBA code for the following.
Range("B3:b5000").formula = "=IF($E3<""d"",""ANZSIC Description"",""Primary Activities"")"
thanks
Printable View
hi,
this following algorithm is in my excel, i would like have a VBA code for the following.
Range("B3:b5000").formula = "=IF($E3<""d"",""ANZSIC Description"",""Primary Activities"")"
thanks
[vba]
If Range("E3").Value < "d" Then
Range("B3:B5000").Value = "ANZSIC Description"
Else
Range("B3:B5000").Value = "Primary Activities"
End If
[/vba]
but, < "d"?
thank you. but in the code the range is my concern. the ways it should be is
for cell b3 it should look at e3
for cell b4 it should look at e4
and so on
please help
If Range("E3").Value < "d" Then
Range("B3:B5000").Value = "ANZSIC Description"
Else
Range("B3:B5000").Value = "Primary Activities"
End If
Okay, so what is wrong with your original code then?
hi,
the original algorithm has $ sign which means it should look at the next cells in column b & E
in simple terms for B3 it should look at E3
and B4 to look at E4
the excel algorith does that with the $ sign, how can we do that in VBA code
Your code increments the line number for each row. Run it and then go look at B3, B4 and so on.