+ Reply to Thread
Results 1 to 5 of 5

Object Required Error in VB Excel Program that Passes Range to a function

  1. #1
    Registered User
    Join Date
    12-01-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    17

    Unhappy Object Required Error in VB Excel Program that Passes Range to a function

    Hi Friends,

    I am trying to pass the formula which gives a range of cells to a function called concatenate_Text which is defined as

    Please Login or Register  to view this content.
    The macro that passes the range is this

    Please Login or Register  to view this content.
    When I try to execute this, it gives me an error saying "Object Required" error. The catch is "I want to send the results of the formula to the function Concatenate_Text ........
    Kindly explain where I am going wrong.

    Thanks in advance for your time
    Last edited by romperstomper; 12-06-2011 at 05:30 AM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,343

    Re: Object Required Error in VB Excel Program that Passes Range to a function

    Change the last line to:
    Please Login or Register  to view this content.
    without the parentheses.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    12-01-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Object Required Error in VB Excel Program that Passes Range to a function

    Quote Originally Posted by romperstomper View Post
    Change the last line to:
    Please Login or Register  to view this content.
    without the parentheses.
    Hi Roomperstomper,

    I tried, but did not work..
    I think its to do with the object definition. I am declaring the range variable.

    but some one please tell me, how to "Set" the range variable with the result of the formula....

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,343

    Re: Object Required Error in VB Excel Program that Passes Range to a function

    I didn't read the line above - you can't assign a range based on a formula like that. Best guess would be:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-01-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Object Required Error in VB Excel Program that Passes Range to a function

    Wow, Thank you so much Romperstomper.. It is working super cool
    Last edited by romperstomper; 12-06-2011 at 05:29 AM. Reason: remove unnecessary quote

+ 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