LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Subroutine Arguments

I am obviously missing something since I can't get this to work. I am
building a subroutine that will work on several worksheets. The Sub would be
initiated by clicking a button on the worksheet. To make it universal, I
need to pass the Worksheet name, the Range to be manipulated, a Range on
another worksheet which holds some data, and a constant. Here is what I have
tried.

On the Worksheet:

Private Sub CommandButton2_Click()
Dim WkSht As String, ANRange As Range, XlSlots As Range, RCol As Long
WkShts = "SheetName"
ANRange = Range("RangeName1")
XlSlots = Range("RangeName2")
RCol = 5
Call BuildReport( WkSht, ANRange, XlSlots, RCol)
End Sub

In Module:
Sub BuildReport( WkSht As String, ANRange As Range, XlSlots As Range, RCol
As Long)

Code
End Sub

Running this code produces a Run-time '1004' Application-defined or
object-defined error.

I have tried several other versions without success. What can I do to fix
this? Thanks in advance for your help!

Ray


 
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
Call a subroutine using variable subroutine name dhstein Excel Discussion (Misc queries) 3 July 26th 09 08:28 PM
SUBROUTINE HELP biker man Excel Discussion (Misc queries) 1 July 28th 07 04:06 PM
Second subroutine to run automatically MatthewT[_7_] Excel Programming 1 January 29th 04 06:59 PM
editing a subroutine ChuckM[_2_] Excel Programming 2 January 12th 04 05:56 PM
Every second subroutine dolegow Excel Programming 1 October 12th 03 02:11 AM


All times are GMT +1. The time now is 07:44 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"