Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy rows and paste onto visible only rk0909 Excel Discussion (Misc queries) 2 April 7th 10 03:05 AM
Copy and paste VISIBLE data Jaytee Excel Discussion (Misc queries) 3 November 1st 08 09:13 PM
Excel copy only visible rows from autofilter duketter Excel Discussion (Misc queries) 2 June 30th 08 10:55 PM
Copy visible cells on Filtered data [email protected] Excel Discussion (Misc queries) 4 July 18th 07 08:18 AM
Can I copy data from only the visible rows in Excel? Sarah Excel Discussion (Misc queries) 1 October 8th 05 09:23 PM


All times are GMT +1. The time now is 04:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"