Wow guys, I totally appreciate you sticking with me on this as long as you have been able to.
It's hard for you guys to understand my confusion because you both obviously are very well versed with VBA and I am totally jealous! lol
.
I'm going to explain in laymens terms here my thoughts and dilemnas and maybe after that, you will be able to give this another attempt if you so wish to.
Okay, so, I am working with 2 workbooks here.
Workbook 1 - Named "Macros", located in my startup folder and is where all my macros are stored in about 80 modules or so.
Workbook 2 - Named "DB Only", saved as an XLSM file so that I can run macros on it.
In my Macro workbook...
I have a form named "UF_Status", and within that form, I have "Image1" and "Image2" which are blank and have no pictures/images loaded into them.
I have a worksheet named "sheet1" (decided it should be in my "Macros" workbook because I want to save with images with my macro workbook and NOT the "DB Only" workbook.
On the worksheet named "sheet1", I have 2 images named "picture 1" and "picture 2".
In my DB Only workbook...
The only worksheet I have in this workbook is called "DB"
Here's what I want...
(keep in mind that I can already do this perfectly by loading the images from a folder location, which is really not what I want)...
While on the DB Only workbook...
1. I want to press a button on my toolbar assigned to run a macro
2. I then want 2 things to take place
a) I want to run this code below...
(note that my code is obviously much much longer than what is below, I simply chose this code because it's short and simple...)
B) WHILE the above code is running..I would like "Picture 1" to show up and then go away, then have "Picture 2" show up and then go away.
And that's it!
Now, from what I gathering here, there seems to be 6 areas that can modified with either code, names or properties..
Area 1. The "sheet1" worksheet of the "Macros" workbook
Area 2. The "sheet1" code of the "Macros" workbook
Area 3. The code area of the form named "UF_Status" in the "Macros" workbook which looks like this...
Area 4. The properties area of the form named "UF_Status" in the "Macros" workbook.
Area 5. Module "X" - That "long" code that romperstomer provided" that begins with this..
Area 6. Module "Y" - That "short" code which is here..
So, having said that here are my questions...
Question 1 - AREA 2 - Do I need to put anything at all in AREA 2, the code of the sheet1 WB?
Question 2- AREA 3 - Code area of the form - Do I need to put anything in this area?
Question 3 - AREA 4 - Properties area of the form - Do I need to change any values in this area, name, pre-load the images, etc?
Question 4 - AREA 5 - Module "X" - Other than copying that long code, is there anything at all i need to modify? For example, what should the module be named? I assume that there's no "Sub" and "End Sub" anywhere in this module?
Question 5 - AREA 6 - The "Short" code - Again, other than copying the short code to a module, is there anything I need to modify? What should this module be named?
Having stated the above, I just realized that there should be NO code at all in the "DB Only" workbook. I want all the pictures and code to reside in the "Macros" workbook so that this awesome macro will work on any workbook, using any person's computer (providing I put the "Macros" workbook in their startup of course.)
I'm basically looking for this at this point...
1. Put THIS code in "AREA 1"
2. Put THIS code in "AREA 2"
3. Name THIS module "X"
etc, etc, etc.
Wow, I am sorry to be so technical with my questions here guys. FYI - I have given you both as many reputation points as possible
I have learned sooo much from this forum in the past year or so. Forms and even functions to a degree are brand new to me and this is proving to be a real challenge. Do whatever you can and even if you can't do anymore, thanks so much for getting me to this point!
Bookmarks