Link to home
Start Free TrialLog in
Avatar of maverick0728
maverick0728Flag for United States of America

asked on

Excel VBA pass range value

I have the following
Sub TestInsertPictureInRange()
  Dim filename As String:  filename = Cells(1, 11)
  Dim rangevalue As Range: Set rangevalue = Range(Cells(1, 12), Cells(1, 13))

  InsertPictureInRange(filename, rangevalue)
    
End Sub

Sub InsertPictureInRange(PictureFileName As String, TargetCells As Range)

End Sub

Open in new window


However, when I put in "rangevalue" in the call to:
InsertPictureInRange(filename, rangevalue)

I get an error:
Compile error:
Expected: =

How should I be passing this?
Avatar of Kimputer
Kimputer

Line 5: InsertPictureInRange filename, rangevalue
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial