LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default vba script code - for emails and creating directory as req'd:

i have the following code for a purchase order:

Sub POInv()
' Macro recorded 8/28/2006 by Jat
'
'Sub SaveName() - multiple steps
ActiveSheet.Copy 'creates a new one page workbook with a copy of
the activesheet in it, this becomes the activesheet/book
ActiveSheet.Name = Range("M5").Value 'renames the active sheet
(from ActiveSheet.Copy) to the purchase order value located in cell M5
strdate = Format(Now, "mm-dd-yy h-mm-ss")
ActiveWorkbook.SaveAs "C:\Documents and Settings\All
Users\Documents\Purchase Orders\" & ActiveSheet.Name & " " & strdate &
".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=True, _
CreateBackup:=False 'saves the renamed active sheet to the
designated folder
'End Sub

'Sub Email() - sends a copy of the email to the recipients(should be
accounts payable department, or similar)
ActiveWorkbook.SendMail "
'End Sub Email()

'Sub PrintOut() - prints out one copy after the sheet has been emailed,
then closes it
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWorkbook.Close SaveChanges:=True 'don't ask - kind of looks
good.
'End Sub

'Sub Count() - increases the PO number (stored in cell K8 and displayed
in M5)
mycount = Range("K8") + 1
Range("K8") = mycount
'End Sub

'Sub ClearContents() - Clears the contents in selected cells Range, and
reverts the actual PO to it's original form

Range("M9,M11,M13,M15,D11:G15,A18:L32,E33,G33,J33, C35,E35,H35,B37:M40,M44,A45:G45").Select
Selection.ClearContents
Application.ScreenUpdating = True
Range("D11:G11").Select
'End Sub

'Sub AutoSave() - saves the blank purchase order with new PO number
ActiveWorkbook.Save
'End Sub

End Sub


now, keeping everything simple as pie (like above), how do i get it to do
the following:
send to mulitple recipients
automatically create the directory if req'd

thank you,

jatman
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating directory for workbook Renee Excel Discussion (Misc queries) 3 August 28th 06 10:00 AM
Creating spreadsheet of Outlook emails [email protected] Excel Programming 2 January 10th 06 02:14 AM
Creating spreadsheet of Outlook emails [email protected] Excel Discussion (Misc queries) 3 January 9th 06 04:33 PM
Creating a macro that lists directory names within a directory.... Andy Excel Programming 4 November 28th 04 06:13 AM
saving/creating a directory Matt B Excel Programming 2 January 19th 04 09:35 PM


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"