View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Daniel Bonallack Daniel Bonallack is offline
external usenet poster
 
Posts: 110
Default Placing values in a range on a non-active sheet

Thanks very much (and to Vasant).



"Jim Thomlinson" wrote:

You can do it but you have to be very explicit with all of your
references.Something like this will work

Sheets("Product").Range(Sheets("Product").Cells(1, 2),
Sheets("Product").Cells(1, 11)).Value = 1000

or you could use a with statement

with Sheets("Product")
.Range(.Cells(1, 2), .Cells(1, 11)).Value = 1000
end with

HTH

"Daniel Bonallack" wrote:

Do I have to select a sheet before placing values in a range?

This works:
Sheets("Product").select
Range(Cells(1, 2), Cells(1, 11)).Value = 1000

This doesn't:
Sheets("Product").Range(Cells(1, 2), Cells(1, 11)).Value = 1000

Thanks in advance.
Daniel