1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  3. When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Seeking up a Macro which can print the sorted data and send email

Discussion in 'VBA Macros' started by dnconan, Jun 7, 2018.

  1. dnconan

    dnconan New Member

    Messages:
    4
    hi experts,

    I have an excel sheet, which contains several columns and data.

    I want to print all data in HTML format in email body, and then send it to someone.

    How can I realize it, can you help to provide Macros for it.

    For example, I have ABCDE with 12345 data, and need to export whole excel into a HTML (but have one condition, that column B > 100;)

    Much appreciate!!!!!!!!!!!!!!!!
  2. AlanSidman

    AlanSidman Active Member

    Messages:
    286
  3. dnconan

    dnconan New Member

    Messages:
    4
    hi AlanSidman, much appreciate for your information, so for the codes, if I want to add filter, can I do it? (not to copy all work sheet, but only the lines which have a column that meets the condition.)

    Code (vb):


        '    'Change all cells in the worksheet to values if you want
       '    With Destwb.Sheets(1).UsedRange
       '        .Cells.Copy
       '        .Cells.PasteSpecial xlPasteValues
       '        .Cells(1).Select
       '    End With
       '    Application.CutCopyMode = False

        'Save the new workbook/Mail it/Delete it
       TempFilePath = Environ$("temp") & "\"
        TempFileName = "Part of " & Sourcewb.Name & " " _
                     & Format(Now, "dd-mmm-yy h-mm-ss")
     
  4. Belleke

    Belleke Active Member

    Messages:
    279
    Hi dnconan,
    Can you post en example of your excelsheet?
    I have a solution but I need an example to adjust the code to your needs.
  5. dnconan

    dnconan New Member

    Messages:
    4
    Hello Belleke,

    Much appreciate for your help.

    Attached my example file, I want to print or copy all line with all columns in the attached xlsx file with conditions "No. Call from Customer (Column P) >0 OR "Last Updated at (Column T)" is 10 days till now.

    I am new to excel VBA and seeking help:)

    Regards,
    Daisuke

    Attached Files:

  6. dnconan

    dnconan New Member

    Messages:
    4

Share This Page