Hi,
I've been trying to teach myself VBA coding so that I can use it at work. This morning, I made a UDF ("Brand") that worked. However, now I want to make another UDF that incorporates the first one, and it's not working and I don't know enough to know why. I've tried changing it in a hundred little ways to debug it, but it keeps coming up with different problems. The point of it is to only list the Brand (which is the result of the Brand function) when it differs from the Brand for the cell above. Can anyone help me out? Thank you so much.
I've been trying to teach myself VBA coding so that I can use it at work. This morning, I made a UDF ("Brand") that worked. However, now I want to make another UDF that incorporates the first one, and it's not working and I don't know enough to know why. I've tried changing it in a hundred little ways to debug it, but it keeps coming up with different problems. The point of it is to only list the Brand (which is the result of the Brand function) when it differs from the Brand for the cell above. Can anyone help me out? Thank you so much.
Code:
Function ApplyBrand(num)
If Brand(num) = Brand(Range("num").Offset(-1, 0)) Then
x = 1
End If
Select Case x
Case Is = 1
ApplyBrand(num) = " "
Case Else
ApplyBrand(num) = Brand(num)
End Select
End Function