![]() |
Copy visible rows with data to new file
All, Need help in extending this macro. This macro currently copy the entire active sheet and then save it into a new workbook/file with sheetname as the filename and append with today'date. This include all the hidden rows (after auto-filtering). I needed something extra i.e. I only want the visible rows (assume auto-filtering already done) to be save to the new workbook/file. Can someone help to modify the existing macro to do this. Thanks in advance. Sub FromSheetoWorkbook() ' ' Create individual workbook from active sheet Macro ' Dim Fname, strMessage As String 'Save active sheet as a workbook with today's date Fname = ActiveSheet.Name & "-" & Format(Date, "ddmmmyy") ActiveSheet.Copy ActiveWorkbook.SaveAs Filename:=Fname & ".xls" ActiveWorkbook.Close SaveChanges:=False ' Display saved message strMessage = Fname & " saved in " & vbCrLf & vbCrLf & CurDir MsgBox strMessage, vbInformation, "File Saved!" ' End Sub -- slc ------------------------------------------------------------------------ slc's Profile: http://www.excelforum.com/member.php...fo&userid=1439 View this thread: http://www.excelforum.com/showthread...hreadid=262691 |
All times are GMT +1. The time now is 08:02 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com