Hello,
I'd like to start this off by saying I know basically nothing about VBA and Macros. I'm trying to learn more during down time for work, but I don't have a lot of that.
A coworker of mine has built a calculator in Excel using many functions and drop downs. One of the functions being used is a VLOOKUP function that, based on a drop down, is returning a cell that either has a single space in it so it appears blank, or a string of text that should act as a warning to a user of the calculator. There is conditional formatting on the cell to highlight it in yellow when that warning is returned, but we would like it to be more eye catching, so we have found a GIF that we would like to have pop up when the warning pops up. We have managed to come up with this string of code;
However when trying to run it, it returns an error that reads "Run-time error 1004: Application-defined or object-defined error"
I've tried searching the internet for what that means and how to fix it, but have not had any luck. Does anybody have an idea of how to make this work?
Thanks in advance!
I'd like to start this off by saying I know basically nothing about VBA and Macros. I'm trying to learn more during down time for work, but I don't have a lot of that.
A coworker of mine has built a calculator in Excel using many functions and drop downs. One of the functions being used is a VLOOKUP function that, based on a drop down, is returning a cell that either has a single space in it so it appears blank, or a string of text that should act as a warning to a user of the calculator. There is conditional formatting on the cell to highlight it in yellow when that warning is returned, but we would like it to be more eye catching, so we have found a GIF that we would like to have pop up when the warning pops up. We have managed to come up with this string of code;
VBA Code:
Sub Main()
If Range(N16) = " " Then
ActiveSheet.Pictures("Picture 4").Visible = False
ActiveSheet.Pictures("Picture 4").Visible = True
End If
End Sub
However when trying to run it, it returns an error that reads "Run-time error 1004: Application-defined or object-defined error"
I've tried searching the internet for what that means and how to fix it, but have not had any luck. Does anybody have an idea of how to make this work?
Thanks in advance!