Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Invalid or unqualified reference error
Getting Invalid or unqualified reference error
Sub wordwrap() Sheets("Sheet1").rows("1:" & .Cells(.rows.Count, "A").End(xlUp).Row).AutoFit End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Invalid or unqualified reference error
Maybe you meant:
With Sheets("Sheet1") .rows("1:" & .Cells(.rows.Count, "A").End(xlUp).Row).AutoFit End With If you use a bare "." like in your ".Cells" it needs to be in the context of a "With...End With" block. I would also suggest qualifying the workbook for the worksheet. Tim "Stanley Braverman" wrote in message ... Getting Invalid or unqualified reference error Sub wordwrap() Sheets("Sheet1").rows("1:" & .Cells(.rows.Count, "A").End(xlUp).Row).AutoFit End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Invalid or unqualified reference error | Excel Programming | |||
Invalid or unqualified reference error | Excel Programming | |||
Invalid or unqualified reference error | Excel Programming | |||
Invalid or unqualified reference error | Excel Programming | |||
Another invalid or unqualified reference | Excel Programming |