+ Reply to Thread
Results 1 to 2 of 2

Passing a Range to UserForm

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Spaiin
    MS-Off Ver
    Excel 2007
    Posts
    1

    Passing a Range to UserForm

    Hi, I am very new to Visual Basic and I am trying to pass the cell clicked on a worksheet to an UserForm and display this UserForm when any single cell is clicked. I need to store this cell on the form for later use.

    To achieve it I am trying to use a property in the UserForm.

    I have this code on my WorkSheet:

    Please Login or Register  to view this content.
    And this code in the UserForm:

    Please Login or Register  to view this content.
    But something is wrong and I don't know what it is... While debugging it says that error 91 "object variable or With block variable not set" was thrown at the line "LocalRange = rng"

    Thank you very much

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Passing a Range to UserForm

    Variable LocalRange is an object so should you not use Set LocalRange....?
    If you like my contribution click the star icon!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1