Invalid or unqualified reference error
Getting Invalid or unqualified reference error at .Cells
Sub wordwrap() Sheets("Sheet1").rows("1:" & .Cells(.rows.Count, "A").End(xlUp).Row).AutoFit End Sub |
Invalid or unqualified reference error
Stanley Braverman;258094 Wrote: Getting Invalid or unqualified reference error at .Cells Sub wordwrap() Sheets("Sheet1").rows("1:" & .Cells(.rows.Count, "A").End(xlUp).Row).AutoFit End Sub Hello Stanley, The period indicates the code statement expects that the Parent qualifier has been declared in a With statement. See below... ---------------------------------------------------- Sub wordwrap() With Sheets("Sheet1") .Rows("1:" & .Cells(.Rows.Count, "A").End(xlUp).Row).Autofit End With End Sub ---------------------------------------------------- -- Leith Ross Sincerely, Leith Ross 'The Code Cage' (http://www.thecodecage.com/) ------------------------------------------------------------------------ Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=72065 |
All times are GMT +1. The time now is 06:57 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com