![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 26
|
hey,
i am writing a macro to save my monthly sale summarys at the end of each month, however, the problem is that i cannot save the files as diffrent names each time, is this possible and if so how? Any help is great, thanx alot Craig |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
how would you like th efile name to be :
loklk at it like in parts .. or just wack the time on the end never two the same then
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#3 | |
|
Board Regular
Join Date: Feb 2002
Posts: 76
|
Quote:
sFileName = ActiveSheet.Range("A1").text & ".xls" |
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Posts: 26
|
thnx,
i will want to name them the month and then year, eg. april 2001, may 2001...etc can this still be used with the formula u gave me? |
|
|
|
|
|
#5 | |
|
Board Regular
Join Date: Feb 2002
Posts: 76
|
Quote:
fname = MonthName(Month(Now)) & Year(Now) If you want to name it according to past months, you need the name of the month and year to be extracted from somewhere. Lets say you keep the date in A1 for each sheet you are saving, do this: Dim old_date As Date Dim File_Name as String old_date = Worksheets("sheet1").Range("A1").Value File_Name = MonthName(Month(old_date)) & Year(old_date) [ This Message was edited by: John McGraw on 2002-04-25 13:11 ] |
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
the codes here adre spot on, but weill not cover your request could clash, thus i gave the answer in my posy admitted not code sugget link else <<<<
see what i mean!
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#7 |
|
New Member
Join Date: Mar 2002
Posts: 26
|
hey thnx alot,
but wud i then just have 2 put some thing like Activeworkbook.save as("fname")? ne way, i'll give it a go thnx again |
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
just playing try adding
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#9 | |
|
Board Regular
Join Date: Feb 2002
Posts: 76
|
Quote:
be saved as "fname", literaly. ActiveWorkbook.Saveas(File_Name) |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|