Type mixture error

F

Freddie Mac

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!
 
B

Bob Phillips

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)
 
J

John.Greenan

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Looping Range 0
Loop and name 3
Checking contents of arrays 1
Syntax error.. 1
Chart making 0
Update charts 0
Highlight a cell after update in a specific range 2
Filtering/Excluding Values 1

Top