Calling subroutines and passing variables

  • Thread starter Thread starter matpj
  • Start date Start date
M

matpj

hi,

I have the following code:

Code
-------------------

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.TextToDisplay = "CPO Reports" Then
a_variable = ActiveCell.Offset(ColumnOffset:=-3).Value
tofield = ActiveCell.Offset(ColumnOffset:=-5).Value

Select Case MsgBox("Email CPO?", vbQuestion + vbYesNo, "Confirm")
Case vbYes: Send_Unformatted_Rangedata (a_variable, tofield)

Case Else: Exit Sub
End Select



End If

End Su
-------------------


but it has a problem with the line:

Code
-------------------
Send_Unformatted_Rangedata (a_variable, tofield)

-------------------


as it displays an error saying "Compile Error Expected: ="

does anyone know what i'm doing wrong?
i'm sure i've passed two variables into another subroutine before...

thanks in advance,
Mat
 
Try

Call Send_Unformatted_Rangedata (a_variable, tofield)

or

Send_Unformatted_Rangedata a_variable, tofield
 

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

Back
Top