Hi all, I'm Rick. New to site and new to VBA also. I started to learn VBA about 3-4 weeks ago and am enjoying it massively. my thirst for knowledge grows with every line of code I write! anyway...
I have a small project and I am one action away from it being complete. in a nutshell I have a small database of suppliers, each has their own dedicated folder containing their documents. basically the macro works down the list and for each row counts the number of files in the supplier folder and returns the count to a cell in a different column on the active row. (i.e for cell reference "A1" it counts all the files in folder "A" and returns the count value to cell "H1").
at this point the macro needs to do one of two things:
if the file count <= 5 then
(create and send email, adding all attachments individually)
else
'THIS IS WHERE ZIPPING WOULD OCCUR
end if
this bit is working no problem at all but I want to zip the folders containing more than 5 documents prior to email. the reason I want top do this is because sometimes there are upwards of 50 ".pdf" documents within these folders and, although outlook will send these emails, nobody likes receiving an email with over 50 individual attachments!
I have tried to use several codes I have found that all say "SOLVED" but I cant get any of them to work. I admit this is no doubt down to my inexperience and lack of knowledge but it is still frustrating as this is the last step in my programme.
what I would like is this. I would like some coding that will "if the file count is > 5" then zip the contents of the supplier folder contents (and preferably delete the original version also so that when complete the supplier folder contains just the zip folder).
please forgive my ignorance but is this something that is possible?
can anyone help?
thank you in advance for anything you can offer
Bookmarks