View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Konrad Viltersten Konrad Viltersten is offline
external usenet poster
 
Posts: 26
Default Strange range behavior (example from Help doesn't work)

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
---------------------------------------------------