Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Macro to email filtered section as attachment

Hi, I would appreciate some assistance with a spreadsheet I need to email to
specific users.
I have a master sheet which details in the first column the State, 2nd
column the managers name, following columns store details and other
information. What I require is a macro to email each manager with their
filtered information. I've successfully used Ron de Bruines "Mail a row or
rows to each person in a range" to do this function (email addy's in a
separate page) but it inbeds the spreadsheet in the email and I require it to
be an attachment. I found a macro to save the managers info in separate
files but was unable to merge this function with an email function within the
same macro. Any help would be much appreciated!!!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 105
Default Macro to email filtered section as attachment

Hi,
Try the following macro :

Sub test()
Dim c As Range, myRange As Range
Set myRange = Range("_filterdatabase").Offset(1)
Set myRange = myRange.Resize(myRange.Rows.Count - 1, 1).Offset(, 1)
Set myRange = myRange.SpecialCells(xlCellTypeVisible)
Workbooks.Add 1
Set wb = ActiveWorkbook
With ThisWorkbook.Sheets("Sheet1")
For Each c In myRange
Range(.Cells(c.Row, 1), .Cells(c.Row, 256).End(xlToLeft)).Copy
wb.ActiveSheet.Paste
wb.SendMail c.Value & ", "Subject"
Next c
End With
wb.Close False
End Sub

The file I tested with is at the following address :

http://www.filedropper.com/tamara

Regards.
Daniel

Hi, I would appreciate some assistance with a spreadsheet I need to email to
specific users.
I have a master sheet which details in the first column the State, 2nd
column the managers name, following columns store details and other
information. What I require is a macro to email each manager with their
filtered information. I've successfully used Ron de Bruines "Mail a row or
rows to each person in a range" to do this function (email addy's in a
separate page) but it inbeds the spreadsheet in the email and I require it to
be an attachment. I found a macro to save the managers info in separate
files but was unable to merge this function with an email function within the
same macro. Any help would be much appreciated!!!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro to email filtered section as attachment

Hi Tamara

I will create a example for you this evening

I will post here when it is online



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Tamara" wrote in message ...
Hi, I would appreciate some assistance with a spreadsheet I need to email to
specific users.
I have a master sheet which details in the first column the State, 2nd
column the managers name, following columns store details and other
information. What I require is a macro to email each manager with their
filtered information. I've successfully used Ron de Bruines "Mail a row or
rows to each person in a range" to do this function (email addy's in a
separate page) but it inbeds the spreadsheet in the email and I require it to
be an attachment. I found a macro to save the managers info in separate
files but was unable to merge this function with an email function within the
same macro. Any help would be much appreciated!!!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro to email filtered section as attachment

Hi Tamara

Test the code on this new page for me
http://www.rondebruin.nl/mail/folder2/row2.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Tamara" wrote in message ...
Hi, I would appreciate some assistance with a spreadsheet I need to email to
specific users.
I have a master sheet which details in the first column the State, 2nd
column the managers name, following columns store details and other
information. What I require is a macro to email each manager with their
filtered information. I've successfully used Ron de Bruines "Mail a row or
rows to each person in a range" to do this function (email addy's in a
separate page) but it inbeds the spreadsheet in the email and I require it to
be an attachment. I found a macro to save the managers info in separate
files but was unable to merge this function with an email function within the
same macro. Any help would be much appreciated!!!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Macro to email filtered section as attachment

Thanks Ron de Bruin - worked like a dream!!
Just another further question, I set up an auto filter on the spreadsheet
and after running the macro this filter disappears.
Is it possible for the filter to remain and for only the name I've filtered
against to be emailed opposed to all names on the sheet?


"Ron de Bruin" wrote:

Hi Tamara

Test the code on this new page for me
http://www.rondebruin.nl/mail/folder2/row2.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Tamara" wrote in message ...
Hi, I would appreciate some assistance with a spreadsheet I need to email to
specific users.
I have a master sheet which details in the first column the State, 2nd
column the managers name, following columns store details and other
information. What I require is a macro to email each manager with their
filtered information. I've successfully used Ron de Bruines "Mail a row or
rows to each person in a range" to do this function (email addy's in a
separate page) but it inbeds the spreadsheet in the email and I require it to
be an attachment. I found a macro to save the managers info in separate
files but was unable to merge this function with an email function within the
same macro. Any help would be much appreciated!!!




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro to email filtered section as attachment

I am not sure I understand what you want

It is better to close Autofilter before we start the macro(I do not do that in this example)
After the macro is ready it close Autofilter with this line

Ash.AutoFilterMode = False
If you remove that line you see the last filter

I not think you want that
Let me know and I try to help you


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Tamara" wrote in message ...
Thanks Ron de Bruin - worked like a dream!!
Just another further question, I set up an auto filter on the spreadsheet
and after running the macro this filter disappears.
Is it possible for the filter to remain and for only the name I've filtered
against to be emailed opposed to all names on the sheet?


"Ron de Bruin" wrote:

Hi Tamara

Test the code on this new page for me
http://www.rondebruin.nl/mail/folder2/row2.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Tamara" wrote in message ...
Hi, I would appreciate some assistance with a spreadsheet I need to email to
specific users.
I have a master sheet which details in the first column the State, 2nd
column the managers name, following columns store details and other
information. What I require is a macro to email each manager with their
filtered information. I've successfully used Ron de Bruines "Mail a row or
rows to each person in a range" to do this function (email addy's in a
separate page) but it inbeds the spreadsheet in the email and I require it to
be an attachment. I found a macro to save the managers info in separate
files but was unable to merge this function with an email function within the
same macro. Any help would be much appreciated!!!


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Macro to email filtered section as attachment

I add also a example for OE and windows Mail users
http://www.rondebruin.nl/sendmail.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Ron de Bruin" wrote in message ...
Hi Tamara

Test the code on this new page for me
http://www.rondebruin.nl/mail/folder2/row2.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Tamara" wrote in message ...
Hi, I would appreciate some assistance with a spreadsheet I need to email to
specific users.
I have a master sheet which details in the first column the State, 2nd
column the managers name, following columns store details and other
information. What I require is a macro to email each manager with their
filtered information. I've successfully used Ron de Bruines "Mail a row or
rows to each person in a range" to do this function (email addy's in a
separate page) but it inbeds the spreadsheet in the email and I require it to
be an attachment. I found a macro to save the managers info in separate
files but was unable to merge this function with an email function within the
same macro. Any help would be much appreciated!!!

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
Sending a Spreadsheet as an Email Attachment vs. Imbedded in Email billbrandi Excel Discussion (Misc queries) 1 April 3rd 08 03:44 AM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
email attachment Holden Caulfield New Users to Excel 0 April 19th 07 05:02 PM
email as attachment k1 New Users to Excel 3 March 19th 07 06:43 PM
Attachment to an email edger Excel Discussion (Misc queries) 0 February 9th 06 05:58 PM


All times are GMT +1. The time now is 04:16 PM.

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"