View Single Post
  #1   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,

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



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

It should be said that the following code does work as
it's supposed to.

Worksheets("Blad3").Range("A1:B3").Font.Italic = True

Now, for a number of reasons i need to use the syntax
from the first Range-way. How can i do that?

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