+ Reply to Thread
Results 1 to 6 of 6

Thread: Macro/VBA Email & File creation

  1. #1
    Registered User
    Join Date
    01-10-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    19

    Macro/VBA Email & File creation

    ATTACHED IS A SAMPLE FILE

    Hi everyone!

    I have Excel 2003. I've got a list of all our employees and who they report to (their managers) and that manager's email address. My ultimate goal is to send each manager an email weekly saying...this is who we show in our system as reporting to you, is it correct? If not, make your changes to the attachment and send it back to us and we'll update our system.

    To do this, I need the following to happen...

    I have one master sheet that lists 12,000 employees. I need some automated process to break this one file into several files (a file for each manager), then attach that file to an email compsed to that specific manager.

    There are about 1,400 managers, so there should be 1,400 emails going out every week. I do understand the Exchange nightmare this will cause but for now, it's our only option as we are not all on one network, so we can't share a file on the network.

    ATTACHED IS A SAMPLE FILE
    Attached Files Attached Files

  2. #2
    Forum Guru mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    3,004

    Re: Macro/VBA Email & File creation

    You might be better using Access 2007 which has some quite elegant functionality built into it to collect data by e-mail. Have a look at http://office.microsoft.com/en-us/ac...154271033.aspx.

    There's also Infopath which allows the construction of customised forms.
    Martin

    Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.

    If my solution has saved you time and/or money, please consider donating to Cancer Research UK.

  3. #3
    Registered User
    Join Date
    01-10-2010
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Macro/VBA Email & File creation

    Thanks for that information. I'm afraid I'm less savvy in Access than I am in Excel. Yikes! Is there any way to get this done using Excel?

  4. #4
    Forum Guru mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    3,004

    Re: Macro/VBA Email & File creation

    Yes but it would be much more complex in Excel and prone to problems as spreadsheets are much more difficult to bulletproof than databases which are designed to be rigorous.
    Martin

    Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.

    If my solution has saved you time and/or money, please consider donating to Cancer Research UK.

  5. #5
    Forum Guru
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,110

    Re: Macro/VBA Email & File creation

    Hi shane.albrandt;

    I just discovered this thread in my subscriptions. Sorry for not answering earlier.

    Don't know if you're still looking for an answer.
    The thread isn't marked "Solved", but I don't want to waste your time if you're satisfied.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  6. #6
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: Macro/VBA Email & File creation

    Sub tst()
      Set ol = CreateObject("outlook.application")
    
      sq = Sheet1.UsedRange
      c01 = sq(2, 4)
    
      For j = 2 To UBound(sq)
        Do Until c01 <> sq(j, 4) Or j = UBound(sq)
          c02 = c02 & vbCr & sq(j, 2)
          j = j + 1
        Loop
    
        With ol.createitem(0)
          .To = c01
          .Subject = "employee check"
          .body = "Your employees: " & c02
          .Send
        End With
    
        c01 = sq(j, 4)
        c02 = sq(j, 2)
        Next
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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