Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming files
How would I go about saving a file as the concatenation of B1,C1, and E1 in a
macro |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming files
with activeworkbook.worksheets("sheet9999")
.parent.saveas filename:="C:\temp\" & _ .range("B1").value & .range("C1").value & .range("E1").value & ".xls" _ fileformat:=xlworkbooknormal end with (untested, watch for typos) Larry wrote: How would I go about saving a file as the concatenation of B1,C1, and E1 in a macro -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming files
filename = range(B1).value & range(C1).value & range(E1).value
I'm assuming that the active sheet is the same sheet where these ranges are stored. You need to have your save code looking something like this: ActiveWorkbook.SaveAs Filename:= _ "C:\Documents and Settings\Customer\Desktop\Book1.xls", FileFormat:=xlNormal _ , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _ CreateBackup:=False "Larry" wrote: How would I go about saving a file as the concatenation of B1,C1, and E1 in a macro |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming files
Is there a way to use the default path that excell is using? if someone else
used this the macro would have to be changed to work for them "Larry" wrote: How would I go about saving a file as the concatenation of B1,C1, and E1 in a macro |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming files
Larry,
CurDir will return the current default path. ThisWorkbook.Path will return the path of the workbook containing the code. ActiveWorkbook.Path will return the path of the workbook that is currently active, which may or may not be the workbook containing the code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting LLC www.cpearson.com (email on the web site) "Larry" wrote in message ... Is there a way to use the default path that excell is using? if someone else used this the macro would have to be changed to work for them "Larry" wrote: How would I go about saving a file as the concatenation of B1,C1, and E1 in a macro |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming files
This is the code I came up with. It seems to work so I guess that is all I
need. I don't think I need to password it. With ActiveWorkbook.Worksheets("sheet1") .Parent.SaveAs Filename:=.Range("B1").Value & .Range("C1"). _ Value & .Range ("E1").Value & ".xls" End With Thanks everyone "Larry" wrote: How would I go about saving a file as the concatenation of B1,C1, and E1 in a macro |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Tab Naming | Excel Discussion (Misc queries) | |||
Creating and Naming a Folder and populating it with files | Excel Programming | |||
Creating and Naming a Folder and populating it with files | Excel Programming | |||
intersection naming transport between files | Excel Discussion (Misc queries) | |||
VBA - Looping thro same naming files in 2 directories........PLEASE HELP | Excel Programming |