Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL: How to refer to a cell on another sheet in VB?

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
GB
Hi there

I am running a loop (for 1=1 to 5000, next i etc) within VB

All runs well, however the following code gives me an error

If Range("'QUOTES'!A" & i).Value = Range("C3").Value then...

Apparently the Range("'QUOTES'!A" & i).Value is wrong.

I want to refer to a cell on Sheet called QUOTES.

What am i doing wrong ???

thanks in advance
 
PROBLEM SOLVED:

Here is a possible solution:

Range("D" & i).Value = Sheets("Quotes").Range("E" & i).Value
 
Hi

You need to refer to the sheets separately via the use of:

Sheets("Quotes").Range("A" & i)

 
I think this begs the question, why such a large loop? Can you post all of your code and explain to us what you're trying to do?

Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a MS MVP? PODA
- Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top