Results 1 to 5 of 5

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

Threaded View

  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

    Public Function Concatenate_Text(Textrange As Range) As String
    Dim str_text As String
    Dim var_cell As Variant
        For Each var_cell In Textrange
            str_text = str_text & " " & var_cell
        Next
        Concatenate_Text = str_text
    End Function
    The macro that passes the range is this

    Dim TopCell As Range
    TopCell = "OFFSET('Data Tab'!$A$2,0,$B$16 - 1,INDEX($B$1:$B$15,$B$16,1),1))"
    Concatenate_Text (TopCell)
    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.

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