PDA

View Full Version : [SOLVED:] filter and send...



sal21
07-27-2004, 12:23 AM
http://www.gssitaly.com/filtre_and_send.zip

My problem:

Step by step.

TIPE OF FILTRE
Example for your experiment is SO.FARMA.MORRA S.P.A.

Filtre from column C.
Send only the filtered sheet for this INTESTAZIONE.
The db of email is in the sheet E_MAIL.

Add the summ of record in D1 of the sheet filtered

TIPE OF EMAIL
Example for experiment is SO.FARMA.MORRA S.P.A.
subject of email:
INSOLUTI & SO.FARMA.MORRA S.P.A. & string in RANGE A & string in RANGE B & string in RANGE I & date sended sheet

Final result of subject:
INSOLUTI SO.FARMA.MORRA S.P.A. 235 04500 40260 25/07/2004

NAME OF SHEET
Final result Name of sheet sended same option of the subject:
INSOLUTI SO.FARMA.MORRA S.P.A. 235 04500 40260 25/07/2004

Before the send email make a copy in C:\INSOLUTI_SENDED\... put here the file sended

Note: the joint string from column A and column B and column I is the index

Nothing INTESTAZIONE are equal from this joint

Note1: the strucure of the file to send is the same from the master shet IMPGATI

hope i am clear....

Jacob Hilderbrand
07-27-2004, 02:42 AM
Is this homework?

sal21
07-27-2004, 02:47 AM
Is this homework?



... not heve understand? what is homework

Jacob Hilderbrand
07-27-2004, 02:51 AM
It just sounded like a homework assignment to me. Anyways try this to send an email.

http://www.vbaexpress.com/kb/getarticle.php?kb_id=97

It shows how to make the subject, attachments etc.

sal21
07-28-2004, 01:45 AM
It just sounded like a homework assignment to me. Anyways try this to send an email.

http://www.vbaexpress.com/kb/getarticle.php?kb_id=97

It shows how to make the subject, attachments etc.i have updating my old file in my first post... download this for your epxeriment.
My problem is when the selected record in column C is not present in the sheet E_MAIL insert this in the bottom sheet E-MAIL

To make a test:

Filtre and select from column C a record not present in the sheet E-MAIL for example ENEL DISTRIBUZIONE S.P.A. and click on button INVIO E-MAIL after appear the msg "E-Mail not present!"

My problem is to copy this record from sheet IMPAGATI (Range A, B and C) in the bottom of sheet E-MAIL same range

My idea is to make appear a tipical msg box with option YES/NO "do you want to insert ENEL DISTRIBUZIONE S.P.A. YES/NO?" if you select YES put this in the bottom of sheet E-MAIL, if is selcet NO exit sub...

I hope to be clear...

Jacob Hilderbrand
07-28-2004, 02:41 AM
Try something like this to add the data:



Dim MyResponse As VbMsgBoxResult
Dim LastRow As Long
MyResponse = MsgBox("Do you want to insert " & ActiveCell.Text, vbYesNo + vbQuestion, "Insert Data Into Archive")
LastRow = Sheets("E-MAIL").Range("A65536").End(xlUp).Row + 1
If MyResponse = vbYes Then
Range("A" & ActiveCell.Row & ":C" & ActiveCell.Row).Copy Destination:= _
Sheets("E-MAIL").Range("A" & LastRow)
Else
Exit Sub
End If

sal21
07-28-2004, 02:46 AM
Try something like this to add the data:



Dim MyResponse As VbMsgBoxResult
Dim LastRow As Long
MyResponse = MsgBox("Do you want to insert " & ActiveCell.Text, vbYesNo + vbQuestion, "Insert Data Into Archive")
LastRow = Sheets("E-MAIL").Range("A65536").End(xlUp).Row + 1
If MyResponse = vbYes Then
Range("A" & ActiveCell.Row & ":C" & ActiveCell.Row).Copy Destination:= _
Sheets("E-MAIL").Range("A" & LastRow)
Else
Exit Sub
End If


But where in my code i insert this line?

Jacob Hilderbrand
07-28-2004, 03:49 AM
at the start after all your other Dim statements.

sal21
07-28-2004, 04:35 AM
at the start after all your other Dim statements.

... very difficult if you like attache me a txt file with my code and your modify. Tks.

Jacob Hilderbrand
07-28-2004, 06:52 AM
Here ya go. I couldnt upload the entire file because it is too big, but the text file is all code for the Module (Modulo1).