+ Reply to Thread
Results 1 to 3 of 3

Type mixture error

  1. #1
    Freddie Mac
    Guest

    Type mixture error

    I am trying to send an array and a variable of the type Range between two
    subs (it works fine without the array) but I get type error in ByVal
    reference. I dont get it. Code:

    Private Sub hittaRubriker(varWorksheetInfoArray As Variant)
    Dim rng1 As Range
    Set rng1 =
    Worksheets(varWorksheetInfoArray(0)).Cells.Find_(varWorksheetInfoArray(1),
    LookIn:=xlValues)
    Call chartMaker(varWorksheetInfoArray, rng1)
    ........

    Private Sub chartMaker(varWorksheetInfoArray As Variant, rng1 As Range)

    Please please help me with this!!!! I would be most greatful!

  2. #2
    Bob Phillips
    Guest

    Re: Type mixture error

    Don't get the error. What doe the code calling hittaRubriker look like?

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Freddie Mac" <[email protected]> wrote in message
    news:[email protected]...
    > I am trying to send an array and a variable of the type Range between two
    > subs (it works fine without the array) but I get type error in ByVal
    > reference. I dont get it. Code:
    >
    > Private Sub hittaRubriker(varWorksheetInfoArray As Variant)
    > Dim rng1 As Range
    > Set rng1 =
    > Worksheets(varWorksheetInfoArray(0)).Cells.Find_(varWorksheetInfoArray(1),
    > LookIn:=xlValues)
    > Call chartMaker(varWorksheetInfoArray, rng1)
    > .......
    >
    > Private Sub chartMaker(varWorksheetInfoArray As Variant, rng1 As Range)
    >
    > Please please help me with this!!!! I would be most greatful!




  3. #3
    John.Greenan
    Guest

    RE: Type mixture error

    is rng1 always a range or can it be nothing if the .Find method finds nothing?

    why not just have chartMaker run the extra lines

    Dim rng1 As Range
    Set rng1 =
    Worksheets(varWorksheetInfoArray(0)).Cells.Find_(varWorksheetInfoArray(1),
    LookIn:=xlValues)

    --
    www.alignment-systems.com


    "Freddie Mac" wrote:

    > I am trying to send an array and a variable of the type Range between two
    > subs (it works fine without the array) but I get type error in ByVal
    > reference. I dont get it. Code:
    >
    > Private Sub hittaRubriker(varWorksheetInfoArray As Variant)
    > Dim rng1 As Range
    > Set rng1 =
    > Worksheets(varWorksheetInfoArray(0)).Cells.Find_(varWorksheetInfoArray(1),
    > LookIn:=xlValues)
    > Call chartMaker(varWorksheetInfoArray, rng1)
    > .......
    >
    > Private Sub chartMaker(varWorksheetInfoArray As Variant, rng1 As Range)
    >
    > Please please help me with this!!!! I would be most greatful!


+ 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