View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default save only selection and subtotal

Not as neat and concise as it could be but does the job.

Operates on client names in column A

Sub create_wkbook()
Dim myval As String
myval = InputBox("Type a Client's Name")
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=myval
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A1").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\program files\microsoft office\exceldata\" _
& myval & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.Close
Selection.AutoFilter
Range("A1").Select
End Sub


Gord Dibben MS Excel MVP

On Sat, 14 Nov 2009 23:40:02 +0100, "Filips Benoit"
wrote:

A marco please

A struggling to save the selection to a new workbook !

F


"Joel" wrote in message
...
I don't know if you want a macro or to do it manually. You can manually
copy
the filter rows by going to worksheet menu

Select the filtered visible rows
Edit - Go To - Special - Visible

Then copy the worksheet to a new workbook and mail like you did before.

"Filips Benoit" wrote:

Hey,

My sheet has 1000 row with payments of clients.
In row 1 i have autofilter to select 1 client
In row 1001 i have the subtotal-function showing the total for this
client.

I should print and email the clients data
The print only show his data, no problem.
But the email shows his data but contains all data !!!

How can i save only the clients data to a new workbook before emailing it
to
the client ??

Thanks,

Filip


.