Chelsea0270516
New Member
- Joined
- Oct 15, 2015
- Messages
- 32
Hello!
I am trying to learn how to use VBA & am still struggling to learn the language. I have a little background in programming (I took a few classes in college) but nothing training wise that is related to VBA.
That said I am trying to create a macro that will do 3 specific things:
I am trying to learn how to use VBA & am still struggling to learn the language. I have a little background in programming (I took a few classes in college) but nothing training wise that is related to VBA.
That said I am trying to create a macro that will do 3 specific things:
- Paste into a specific cell in the document I am working in. (I'll be copying from another excel book)
- Save in a particular format. Both in a specific location that is on a shared drive & with the title I have set up in the sheet.
- Email (through outlook) to a specific email address with a generic text in the body of the email.
Code:
Sub Macro2()
'
' Macro2 Macro
'
'
Range("C14").Select
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
False, NoHTMLFormatting:=True
ActiveWorkbook.SaveAs Filename:= _
Sheets("sheet1").Cells(1, 1).value_
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False **
End Sub
[/end code]
The ** is where the error is at currently. (I haven't been able to affirm that this code does what I want it to yet since I haven't been able to figure out what to do about the error.)
"Compile error: Syntax error"
Background information: The file that is being updated is an internal order form. I am sending 30-70 nearly identical copies of this form to the order department with the only change being 1 cell (C14) having the pasted in ID.
The file needs to save in the following format (which I think I figured out how to do)
C14-CMM-DDMMYY in a particular folder.
I ended up putting this in a separate sheet & it will auto-populate the cell with what I need...I think anyway. Name of this sheet is "sheet1"
=CONCATENATE("L:\data\Chelsea\Internal Orders\",TEXT(TEMPLATE!C14,"####"),"-CMM-",TEXT(TEMPLATE!O4,"mmddyy"))
comes out as: L:\data\Chelsea\Internal Orders\2227-CMM-101515
I am using Microsoft 2013.
Any suggestions, coding ideas, resources, videos, etc would be appreciated.
Thank you!