Hello!
Today is my first day exploring VBA coding, and I'm having trouble with the below 'if/then' VBA code (also attached a screenshot).
In short, what I need is for data in Column E to automatically populate according to what is in Column D. For example, if any rows in Column D read "Fedex", then the corresponding rows in Column E will populate with the word "Marketing."
The error message I keep receiving is "Run-time error: Type '13': Type mismatch", so I thought it would be better to reach out for help rather than continue screwing up on my own.
If it's helpful, I'm currently doing this from a 2019 Macbook Pro, and my version of Excel is 16.68, licensed through Microsoft 365.
Thank you in advance for any help whatsoever!
Today is my first day exploring VBA coding, and I'm having trouble with the below 'if/then' VBA code (also attached a screenshot).
Private Sub Test()
If Range("D2:D200").Value = "FedEx" Then
Range("E2:E200").Value = "Marketing"
End If
End Sub
In short, what I need is for data in Column E to automatically populate according to what is in Column D. For example, if any rows in Column D read "Fedex", then the corresponding rows in Column E will populate with the word "Marketing."
The error message I keep receiving is "Run-time error: Type '13': Type mismatch", so I thought it would be better to reach out for help rather than continue screwing up on my own.
If it's helpful, I'm currently doing this from a 2019 Macbook Pro, and my version of Excel is 16.68, licensed through Microsoft 365.
Thank you in advance for any help whatsoever!