Using a Range variable to call a procedure with a ByVal statem
On Sep 17, 1:49*pm, JLGWhiz wrote:
I am trying to call a procedure and I can't figure out how to do it
correctly.
To call a procedu
Sub callProc()
* * Call ProcedureName *'ProcedureName is everything between Sub and ().
End Sub
Opening a workbook in not calling a procedure.
Calling a procedure is not opening a workbook.
Workbook_Open is an event procedure and not a method to open workbooks or to
call other procedures.
It helps us if you can use the correct terminology to describe your problem,
but when you are just beginning, we understand if you don't.
"R Tanner" wrote:
On Sep 17, 12:47 pm, JP wrote:
The Workbook_Open event doesn't take any arguments. It is placed in
the ThisWorkbook module for a workbook and runs when that workbook is
opened. Where did you come up with that code?
--JP
On Sep 17, 2:23 pm, R Tanner wrote:
Hi,
I am trying to call a procedure and I can't figure out how to do it
correctly. *This is my call statement.
*WorkBook_Open
(filename:=Range("O2").Value,cutrange:=range("O5") .address)
The following is the procedure I am trying to call:
Private Sub WorkBook_Open(ByVal FileName As String, ByVal CutRange As
Range)- Hide quoted text -
- Show quoted text -
Okay I changed the name to just Book_Open. *It still doesn't work. *I
want to pass two variables to this Book_Open procedure....what am I
doing wrong?- Hide quoted text -
- Show quoted text -
Yes, I thought I had made myself clear when I said I was sorry for
getting Workbook_Open confused with what I am trying to do. I am
using this procedure to open a workbook. Period. How do I pass a
range argument to it, as I have previously outlined.
Again...
What do I need to change about this syntax?
BOpen(filename:=Range("O2").Value,cutrange:=range( "O5").address)
If this is the procedure I am trying to call...
Private Sub BOpen(ByVal FileName As String, ByVal CutRange As
Range)
|