Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default save only selection and subtotal

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default save only selection and subtotal

On 14 Nov, 18:46, "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


Try pasting row 1001 (sub total) into a new sheet when you do paste
make sure is a "Paste Special" on the edit and link it to the main
sheet.

Johnnyboy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default save only selection and subtotal

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


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default save only selection and subtotal

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


.



  #5   Report Post  
Posted to microsoft.public.excel.programming
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


.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default save only selection and subtotal

I modified one of rond De Bruin's macros.


Sub Mail_Workbook()
' Works with Excel 97-2007.
Dim wb As Workbook

Set wb = Workbooks.Add(template:=xlWBATWorksheet)

With ThisWorkbook.ActiveSheet
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
.Rows("1:" & Lastrow).SpecialCells(Type:=xlCellTypeVisible).Cop y _
Destination:=wb.Sheets(1).Rows(1)
End With


' Check to see if this is Excel 2007 and is not a macro-enabled file.
If Val(Application.Version) = 12 Then
' The code 51 represents the enumeration for a macro-free Excel 2007
Workbook (.xlsx).
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file that will be removed if
you try to send this file." & vbNewLine & _
"Save the file first as xlsm and then try the macro again.",
vbInformation
Exit Sub
End If
End If

"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


.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default save only selection and subtotal

Finaly it becaume this and works ok, thanks

Set Destwb = Workbooks.Add(template:=xlWBATWorksheet)

With ThisWorkbook.ActiveSheet
Lastrow = .Range("J" & Rows.Count).End(xlUp).Row
.Rows("2:" & Lastrow).SpecialCells(Type:=xlCellTypeVisible).Cop y
Destination:=Destwb.Sheets(1).Rows(1)
End With

Filip



"Joel" wrote in message
...
I modified one of rond De Bruin's macros.


Sub Mail_Workbook()
' Works with Excel 97-2007.
Dim wb As Workbook

Set wb = Workbooks.Add(template:=xlWBATWorksheet)

With ThisWorkbook.ActiveSheet
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
.Rows("1:" & Lastrow).SpecialCells(Type:=xlCellTypeVisible).Cop y _
Destination:=wb.Sheets(1).Rows(1)
End With


' Check to see if this is Excel 2007 and is not a macro-enabled file.
If Val(Application.Version) = 12 Then
' The code 51 represents the enumeration for a macro-free Excel 2007
Workbook (.xlsx).
If wb.FileFormat = 51 And wb.HasVBProject = True Then
MsgBox "There is VBA code in this xlsx file that will be removed if
you try to send this file." & vbNewLine & _
"Save the file first as xlsm and then try the macro again.",
vbInformation
Exit Sub
End If
End If

"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


.



.



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
SUBTOTAL - dynamic selection Totteridge Ram Excel Worksheet Functions 3 December 17th 08 01:09 AM
How to do Selection.Subtotal in VBScript/ASP ? Don Smith Excel Programming 1 May 18th 06 08:53 PM
Subtotal line selection Jenny Excel Discussion (Misc queries) 1 April 13th 05 02:21 PM
Save Selection John[_94_] Excel Programming 3 September 14th 04 05:10 PM
How to do selection.subtotal in VBScript/ASP ? Wes[_5_] Excel Programming 3 December 9th 03 09:43 PM


All times are GMT +1. The time now is 10:23 PM.

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

About Us

"It's about Microsoft Excel"