A little correction

Sub cleanrowsandcolumnsSAS()
   lr = Cells.Find("*", Cells(Rows.Count, Columns.Count) _
        , , , xlByRows, xlPrevious).Row *+ 1*
   lc = Cells.Find("*", Cells(Rows.Count, Columns.Count) _
        , , , xlByColumns, xlPrevious).Column *+ 1*
   Application.EnableEvents = False
   Rows(lr).Resize(Rows.Count - lr).Delete
   Columns(lc).Resize(, Columns.Count - lr).Delete
   Application.EnableEvents = True
   ActiveWorkbook.Save
End Sub

'--thank you
siti Vi


On Tue, Aug 23, 2011 at 7:37 PM, dguillett1 <dguille...@gmail.com> wrote:

>   If I understand your request, you may like this. It also saves the file
>
> Sub cleanrowsandcolumnsSAS()
> lr = Cells.Find("*", Cells(Rows.Count, Columns.Count) _
> , , , xlByRows, xlPrevious).Row
> lc = Cells.Find("*", Cells(Rows.Count, Columns.Count) _
> , , , xlByColumns, xlPrevious).Column
> Application.EnableEvents = False
> Rows(lr).Resize(Rows.Count - lr).Delete
> Columns(lc).Resize(, Columns.Count - lr).Delete
> Application.EnableEvents = True
> ActiveWorkbook.Save
> End Sub
>
>  *From:* Amit Desai (MERU) <amit.de...@merucabs.com>
> *Sent:* Tuesday, August 23, 2011 1:32 AM
> *To:* excel-macros@googlegroups.com
> *Subject:* $$Excel-Macros$$ how to delete multiple row & coulmns
>
>
> Dear All,****
>
> ****
>
> Please let me know how to delete multiple rows(say from my last data based
> row # 678 to last row) & multiple columns (say from AA to last column).***
> *
>
> ****
>
> This is taking a lot of file size…****
>
> ****
>
> Best Regards,****
>
> Amit Desai****
>
> ****
>

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to