Hi,
I have a macro with these lines in it:
FName = Cells(2, 2).Value
ActiveWorkbook.SaveAs Filename:=FName
This works fine and saves the file as the value in the cell - however I want
to be able to call the file by the value in three cells and also add some
text, so the file name would look like:
quot;Reference (Cells (2,2).Value) Region (Cells (4,2).Value) Day (Cells
(5,2).value)quot;
Can anyone help??????--
Cillian
dim myFileName as string
with worksheets(quot;Sheet99quot;)
myfilename = .cells(2,2).value amp; quot; Region quot; amp; .cells(4,2).value _
amp; quot; Day quot; amp; .cells(5,2).value
end with
Remember that if any of those cells contain a date, you may have to format the
value to use it as a file name:
.... amp; quot; Day quot; amp; format(.cells(5,2).value,quot;yyyymmddquot;)
Cillian wrote:
gt;
gt; Hi,
gt;
gt; I have a macro with these lines in it:
gt;
gt; FName = Cells(2, 2).Value
gt; ActiveWorkbook.SaveAs Filename:=FName
gt;
gt; This works fine and saves the file as the value in the cell - however I want
gt; to be able to call the file by the value in three cells and also add some
gt; text, so the file name would look like:
gt;
gt; quot;Reference (Cells (2,2).Value) Region (Cells (4,2).Value) Day (Cells
gt; (5,2).value)quot;
gt;
gt; Can anyone help??????
gt;
gt; --
gt; Cillian
--
Dave Peterson
- Sep 23 Tue 2008 20:46
Save as Macro in excel
close
全站熱搜
留言列表
發表留言