View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Strange range behavior (example from Help doesn't work)

Hi Konrad,

Providing that I use fully qualified range references, as suggested in both
Leo's response and mine, I am unable to replicate your error.


---
Regards,
Norman



"Konrad Viltersten" wrote in message
...
I ran the following example from the Help.

Worksheets("Blad3").Range(Cells(1, 1), Cells(3, 2)).Font.Italic =
True To my astonishment i get an error - 1004. The description
is rather vague and i have no idea how to shoot down
this one. Any suggestions?


Your code will work if the sheet Blad3 is the active sheet. In case
it is not the active sheet, try:

With Worksheets("Blad3")
.Range(.Cells(1, 1), .Cells(3, 2)).Font.Italic = True
End With



Sorry, no such luck. The worksheet _IS_ active. Just to be
sure i tested the suggested solution but to no avail. The very
same error occured.

Using Cells i can get do the changes i wish to see but i need
to do them in a larger blocks so Range(Cells(,),Cells(,)) would
be very useful.

--
Vänligen
Konrad
---------------------------------------------------

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sence to be lazy
---------------------------------------------------