Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is an example:
'============= ActiveWorkbook.SaveAs Filename:= _ sNewItem & "\Template ISO " & sSheetName & " Audit mm.dd.yy.xlsx", _ FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False, WriteResPassword:="xxxx" '============= The "_" underscore after "ActiveWorkbook.SaveAs Filename:=" is a row continuation symbol that lets you break lines into rows. There are two underscores in this example. ( The symbols and < used to stop confusion of ("") quote usage. The string sNewItem & "\Template ISO " & sSheetName & " Audit mm.dd.yy.xlsx"<< means: sNewItem is a variable (string) that contains the folder path "\Template ISO " is simply text sSheetName is a variable for the sheet name " Audit mm.dd.yy.xlsx" is simply text (spaces intentional in this case) My example would create this string: (Assuming sNewItem is "C: \Myfolder" and sSheetName is "MySheet") C:\Myfolder\Template ISO MySheet Audit mm.dd.yy.xlsx If you want to replace a variable with text simply use "" quotes around the text. "C:\Myfolder" & "\Template ISO " & "MySheet" & " Audit mm.dd.yy.xlsx" will create the same result as my example. C:\Myfolder\Template ISO MySheet Audit mm.dd.yy.xlsx Also I show the use of password protecting the sheet (WriteRespassword). Changing "WriteRespassword" to "Password" will protect the workbook and not the sheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 Macro/VB Question DDE Question | Excel Worksheet Functions | |||
excel 2007 macro question | Excel Discussion (Misc queries) | |||
Excel 2007 Macro Question | Excel Discussion (Misc queries) | |||
Excel 2007...what is the main programing tool | Excel Discussion (Misc queries) | |||
excel question borderline programing | New Users to Excel |