Hi,
I require some help with a problem I am having in excel. I require a macro that will read an adjacent cell and return a specific value...i.e if b3 = "xyz" then c3=a3. This would seem simple enough and can be easily done through a simple IF function without the need for Macros, however things become more complex.
- If b3 = xyz, then all the remaining cells within the range (for example b3 to b10) shoud remain blank
- In the event that b3 <> xyz then the macro must consider the next best option
- The next best option would be defined as if b3 = "abc" then c3=a3, with again the remaining cells within the range that the macro covers remaining blank
Essentially i would like the module to look through the range until one of the options occurs.
Excuse my novice attempt at vba code but I was thinking it would look something like:
If B3 = "xyz" Then
C3 = A3
C4 = ""
C5 = ""
C6 = ""
C7 = ""
C8 = ""
End If
If B3 = "abc" Then
C3 = A3
C4 = ""
C5 = ""
C6 = ""
C7 = ""
C8 = ""
End If
Can anyone please advise on how to move forward with this and any other suggestions?
Thanks.
Bookmarks