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

  • 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

dnconan

New Member
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!!!!!!!!!!!!!!!!
 
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:
    '    '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")
 
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.
 
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
 

Attachments

  • example for your help.xlsx
    8.8 KB · Views: 1
Back
Top