I've been trying to make a Macro, but I'm having trouble figuring it out. Here's what it should do.
Macro function: When the macro is used it should switch to either a sheet called "Products" only if the current tab is NOT the "Products" tab, and if the current tab is the "Products" tab is should go to the previously visited tab.
Use: Let's say I'm on sheet index 3 and use the macro--it should activate the "Products" tab, and if I press it again it should return me to sheet index 3.
I've been trying to use ActiveSheet.Index
and Sheets("Products").Index
in some way, but I think I need to use something beyond my current knowledge of Visual Basics. I haven't used the Public function when declaring global variables and passing information between stuff much either.
Can someone point me in the right direction or tell me what I should use/look into? Is this even possible in VBA?