Range("A1") Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I have a question that has bothered me for a while.
I have a procedure in Excel VBA that gets input from excel worksheet. I have
3 worksheets in the workbook, input, sheet2, and misc.

my procedure in the module is

GetInput(F as double, Q as double)

I call the procedure thus;

call GetIput(range("input!A1").value)

and

call GetInput(range("misc!A1").value)

the strange thing is the first call statement executes without problem but
the second reports errors. it does not understand the range statement.
I have worked around this by using the following for the second call statement

call GetInput(worksheet("misc").range("A1").value).

My question is, why doesn't the statement with the range("misc!A1") work. I
will appreciate some assistance on this.
Kuze
 
It the call in the worksheet module. if so, the unqualified Range refers to
the sheet where the code is located - which means you have a single range
statement refering to multiple sheets.

try using
GetInput [Misc!A1]
 
Thanks will try that.


Tom Ogilvy said:
It the call in the worksheet module. if so, the unqualified Range refers to
the sheet where the code is located - which means you have a single range
statement refering to multiple sheets.

try using
GetInput [Misc!A1]


--
Regards,
Tom Ogilvy

Kuzemdoo Dawuni said:
Hi all,
I have a question that has bothered me for a while.
I have a procedure in Excel VBA that gets input from excel worksheet. I have
3 worksheets in the workbook, input, sheet2, and misc.

my procedure in the module is

GetInput(F as double, Q as double)

I call the procedure thus;

call GetIput(range("input!A1").value)

and

call GetInput(range("misc!A1").value)

the strange thing is the first call statement executes without problem but
the second reports errors. it does not understand the range statement.
I have worked around this by using the following for the second call statement

call GetInput(worksheet("misc").range("A1").value).

My question is, why doesn't the statement with the range("misc!A1") work. I
will appreciate some assistance on this.
Kuze
 

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