Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy rows and paste onto visible only | Excel Discussion (Misc queries) | |||
Copy and paste VISIBLE data | Excel Discussion (Misc queries) | |||
Excel copy only visible rows from autofilter | Excel Discussion (Misc queries) | |||
Copy visible cells on Filtered data | Excel Discussion (Misc queries) | |||
Can I copy data from only the visible rows in Excel? | Excel Discussion (Misc queries) |