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
|