View Single Post
  #6   Report Post  
abbruno abbruno is offline
Junior Member
 
Posts: 8
Default

This worked great!!! I did have to move around some of my other code to get r working properly, but it is doing just what I wanted it to now.

Thanks again!

Quote:
Originally Posted by joeu2004[_2_] View Post
"abbruno" wrote:
I am getting a compile error (For Each control variable
must be variant or object) Can you please tell me what
is wrong and how to fix this?


My bad! Sometimes I forget VBA's subtle foibles.

Fix this problem by changing the type of shName from String to Variant.
That is:

Dim shName As Variant

I did not sanity-check the rest of the code.