Results 1 to 4 of 4

Export Excel sheets and send them as emails (Loop)

Threaded View

  1. #3
    Registered User
    Join Date
    09-06-2017
    Location
    New York
    MS-Off Ver
    MS Office 2010
    Posts
    10

    Re: Export Excel sheets and send them as emails (Loop)

    Thank you alansidman for your suggestion. I've attached an Excel file. Below is the code that I have so far (not much...). I haven't reached the loop and send emails part yet.

    Sub Create_Files()
    
    Dim MyDateStr As String
    Dim wkbCurrent As Workbook
    Dim wkbtemp As Workbook
    Dim wkbtemp2 As Workbook
    Dim MyLocation As String
    Dim SheetName As String
    
    Set wkbCurrent = ActiveWorkbook
    MyDateStr = wkbCurrent.Sheets("Control").Range("F12")
    
    ChDir "W:\Finance Analysis\Contsys2\DATA\aacorpfinance\_yr 2017\Expense reports\"
          If Len(Dir(MyDateStr, vbDirectory)) = 0 Then
            MkDir (MyDateStr)
        End If
        
        MyLocation = "W:\Finance Analysis\Contsys2\DATA\aacorpfinance\_yr 2017\Expense reports\"
        
    SheetName = wkbCurrent.Sheets("Emails").Range("C2")
    
    Set wkbtemp = Workbooks.Add
    
    wkbCurrent.Sheets(SheetName).Cells.Select
    
    
    With wkbtemp
    wkbtemp.Sheets("Sheet1").Range("A1").PasteSpecial
    
    
    
    wkbCurrent.Sheets("M & A").Copy
    wkbtemp2.Sheets("Sheet2").Range("A1").Select
    ActiveSheet.PasteSpecial Paste:=xlValues
    
    Set wkbtemp = Sheets.Add(After:=Sheets(Sheets.Count))
    End With
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel vba to auto-send customer emails (duplicate emails issue)
    By nadz84 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-29-2015, 10:08 AM
  2. Send Emails once expiry date is reached, and generate report based on emails sent
    By demonicscorpion in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2014, 05:36 AM
  3. [SOLVED] Macro To Send Emails with PDF: Multiple Emails and PDF's
    By totoga12 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-19-2014, 06:13 PM
  4. [SOLVED] Loop through rows/columns H and K in filtered table and send emails - Help Please Gurus ;)
    By Alina1404 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2012, 03:23 AM
  5. Send outlook emails with message in cells to individual emails associated with them
    By abinayan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2011, 06:11 AM
  6. Sending macro emails using excel: Send emails with their passwords.
    By loveisblind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2009, 03:16 PM
  7. [SOLVED] Can Excel send out emails?
    By Robert Hodge in forum Excel General
    Replies: 1
    Last Post: 01-10-2006, 06:15 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1