Results 1 to 19 of 19

Thread: Solved: New to VBA - Help me in making this code shorter and better

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Quote Originally Posted by vicks
    Hi I did some trial and error and could solve it. Here is the code which i used. Apprantely Set Wb = was missing from the second loop. Can you tell me what does Set do?
    It assigns an object to an object variable.

    Most variables such as

    myvar = 10

    are really saying

    Let myvar = 10

    Set is used to distinguish objects from data types.
    Last edited by Bob Phillips; 02-06-2009 at 10:55 AM.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •