View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Placing values in a range on a non-active sheet

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