Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Generation of filenames

Hi everyone,

I am in the process of creating a spreadsheet (a form to be precise)
where users insert data. The form is then sent to myself for collation.
I am trying to automate the process for the creation of the file name.

I have come up with the following:

filesaveName = "EEF" + " " + Worksheets(1).Range("E7") + " " +
Worksheets(1).Range("E9") + " " + Application.Text(Now(),
"dd-mm-yyyy") + " - " + Application.Text(Now(), "hhmm") + "h" & ".xls"
ActiveWorkbook.SaveAs (ActiveWorkbook.Path & "\" & filesaveName)
ActiveWorkbook.SendMail Recipients:=xxx

Supposedly this would generate a title such as EEF Event Date1 Date2
Time.xls

I have used used a very similar macro in the past that has worked fine.
It didn't contain the "Worksheets(1).Range("X"), which I understands
will read the values of a given cell and make them part of the
filename.

Any suggestions? Thanks in advance

:-)

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Generation of filenames

If you want to concatenate different strings and string-variables, use
the ampersand (&) instead of the plus-sign (+).

Thus:

filesavename = "EFF " & Worksheets(1).Range("E7") & " " & Worksheets
(1).Range("E9") & etc...

HTH, CoRrRan

"correomaster" wrote in
oups.com:

Hi everyone,

I am in the process of creating a spreadsheet (a form to be precise)
where users insert data. The form is then sent to myself for collation.
I am trying to automate the process for the creation of the file name.

I have come up with the following:

filesaveName = "EEF" + " " + Worksheets(1).Range("E7") + " " +
Worksheets(1).Range("E9") + " " + Application.Text(Now(),
"dd-mm-yyyy") + " - " + Application.Text(Now(), "hhmm") + "h" & ".xls"
ActiveWorkbook.SaveAs (ActiveWorkbook.Path & "\" & filesaveName)
ActiveWorkbook.SendMail Recipients:=xxx

Supposedly this would generate a title such as EEF Event Date1 Date2
Time.xls

I have used used a very similar macro in the past that has worked fine.
It didn't contain the "Worksheets(1).Range("X"), which I understands
will read the values of a given cell and make them part of the
filename.

Any suggestions? Thanks in advance

:-)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Generation of filenames

Thank you so much CoRrRan.

It's worked a treat.

Much obliged.

Regards

Jon

On 25 Jan, 13:39, CoRrRan wrote:
If you want to concatenate different strings and string-variables, use
the ampersand (&) instead of the plus-sign (+).

Thus:

filesavename = "EFF " & Worksheets(1).Range("E7") & " " & Worksheets
(1).Range("E9") & etc...

HTH, CoRrRan


Reply
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
Using cell value in filenames Neil Beddell Excel Worksheet Functions 3 July 19th 06 08:22 PM
getting filenames jim9912 Excel Programming 3 March 30th 06 05:55 PM
Help with filenames and paths. jim9912 Excel Discussion (Misc queries) 2 March 30th 06 05:52 PM
Getting filenames via VBA Andrew Excel Programming 5 April 15th 05 12:41 PM
Variable Filenames Paul Kendall Excel Programming 2 October 13th 03 03:30 PM


All times are GMT +1. The time now is 09:54 PM.

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

About Us

"It's about Microsoft Excel"