Consulting

Results 1 to 10 of 10

Thread: filter and send...

  1. #1

    filter and send...

    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....

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Is this homework?

  3. #3
    Quote Originally Posted by DRJ
    Is this homework?


    ... not heve understand? what is homework

  4. #4
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    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.

  5. #5
    Quote Originally Posted by DRJ
    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...

  6. #6
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Try something like this to add the data:

    [vba]
    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
    [/vba]

  7. #7

    TKS FOR SPEEDLY... REPLY

    Quote Originally Posted by DRJ
    Try something like this to add the data:

    [vba]
    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
    [/vba]
    But where in my code i insert this line?

  8. #8
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    at the start after all your other Dim statements.

  9. #9
    Quote Originally Posted by DRJ
    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.

  10. #10
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •