Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Calling subroutines and passing variables


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

--
matp
-----------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=52760

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Calling subroutines and passing variables

Try

Call Send_Unformatted_Rangedata (a_variable, tofield)

or

Send_Unformatted_Rangedata a_variable, tofield

--
Regards,
Tom Ogilvy



"matpj" wrote:


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 Sub
--------------------


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,
Matt


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=527607


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA - passing Variables to subroutines Madduck Excel Discussion (Misc queries) 12 September 19th 08 03:20 AM
Calling subroutines from Class Modules davidm Excel Programming 1 February 23rd 06 03:42 AM
Calling a Sub passing Textbox name Ducttape19 Excel Programming 2 April 7th 04 01:35 PM
Calling Add-In subroutines from other modules sclark Excel Programming 6 February 3rd 04 05:45 PM
Calling Subroutines/User Functions from Macros Neil Strong Excel Programming 2 December 5th 03 11:03 AM


All times are GMT +1. The time now is 09:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"