Thanks, wasn't really looking to do THIS but it let me implement what I wanted. A macro that will only execute when a certain state is present in the sheet, (which is checked by formulas on the sheet itself, which is what I'm looking at.) and otherwise launches a customized error message telling them to look at the messages and fix it before trying again.
Very nifty, though I see a potential (and not improbable) issue with this solution as the image name refers to a cell which could be changed. If a column is inserted before col. F, for example, the code fails. A useful presentation nonetheless, which I could apply. Thanks again, appreciated...
Exacly one week ago i wrote macro with this same concept, but i running userforms after select shapes. Public Sub RunForm()
Dim strShapeName As String Dim shpSelected As Shape
strShapeName = Application.Caller
Set shpSelected = ActiveSheet.Shapes(strShapeName) Select Case shpSelected.name ' after select shapes with name getQuery, userform with name getQuery shows up Case "getQuery" getQuery.Show Case "addQuery" AddQuery.Show End Select
I can't think of a way to make it work with Office Scripts. At present, they can't identify which button triggered the script, and a button can only run a single script. It would be amazing if they could.
One button for them all..."my precious".
Great video. Thanks for your time and effort.
Thanks, wasn't really looking to do THIS but it let me implement what I wanted.
A macro that will only execute when a certain state is present in the sheet, (which is checked by formulas on the sheet itself, which is what I'm looking at.) and otherwise launches a customized error message telling them to look at the messages and fix it before trying again.
What a great idea. I had never even considered that scenario.
I wonder what I could use that technique for. 🤔
@@ExcelOffTheGrid Thanks! Always nice to hear that I had an idea that even someone so much more knowledgeable than me hasn't had before lol
Another great tutorial with a lot of added value. Spectacular operation of the macro. Thank you very much Mark.
You're welcome Ivan. I'm glad you enjoyed it.
Now this is really cool! I can not wait to start using it!
Thank you for creating/sharing this Mark!
Please do use it. 👍
You'll be seeing it in one of the academy tools very soon.
Excellent video. Thanks our clever Mark for sharing this trick. Looking forward to more! ❤👍🌹☺️
Thanks Kebin 😄
Great (& useful) trick, Mark. Thanks again for sharing your knowledge.
My pleasure! 😁
Good idea for calculating processes with several steps. :)
Very nifty, though I see a potential (and not improbable) issue with this solution as the image name refers to a cell which could be changed. If a column is inserted before col. F, for example, the code fails. A useful presentation nonetheless, which I could apply. Thanks again, appreciated...
You can use a named range instead of a cell reference. This doesn't require any changes to the macro code, it should still work 😀
Exacly one week ago i wrote macro with this same concept, but i running userforms after select shapes.
Public Sub RunForm()
Dim strShapeName As String
Dim shpSelected As Shape
strShapeName = Application.Caller
Set shpSelected = ActiveSheet.Shapes(strShapeName)
Select Case shpSelected.name
' after select shapes with name getQuery, userform with name getQuery shows up
Case "getQuery"
getQuery.Show
Case "addQuery"
AddQuery.Show
End Select
End Sub
It took me a really long time to think of that, and it turns out I could have just copied you. 🤣
Good work.
Could this be done with an office script button?
I can't think of a way to make it work with Office Scripts. At present, they can't identify which button triggered the script, and a button can only run a single script.
It would be amazing if they could.
What a nice challenge
Very nifty!
...but surprisingly simple 😀