Thread: worksheets
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mark Ivey Mark Ivey is offline
external usenet poster
 
Posts: 120
Default worksheets

Here is an interesting alternative...

If you didn't want to activate the sheet, you could try something like this:

With Worksheets("Sheet1").Cells(1, 1)
.Value = "foo"
End With

With Worksheets("Sheet1").Cells(2, 1)
.Value = Sheets(1).Cells(1, 1).Value
End With


Mark Ivey



"Charlie" wrote in message
...
I found this in the help file:
Worksheets("Sheet1").Activate

Do I need to use this .activate command and then this:

with worksheets("sheet1")
.range("A1") = "foo"
.cells(2,1) = .range("A1")
end with

...or can I just use this with command to activate whichever sheet I'm
refering to?
thanks.