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;260814 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 Stanely, You can write this a couple of ways: --------------------------------------------------------------- Sheets("Sheet1").rows("1:" & Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row).AutoFit With Sheets("Sheet1") .rows("1:" & .Cells(Rows.Count, "A").End(xlUp).Row).AutoFit End With --------------------------------------------------------------- -- 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=72780 |
All times are GMT +1. The time now is 05:01 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com