Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Saving a copied workbook - 2 questions

I have a workbook that has data for entire month. Date, Sales, Credits,
Debits, Expenses, etc.

At the end of the month when I make a copy of this workbook and paste it to
a new workbook the Date in the first row changed to the previous day (last
day of the previous month). All the other dates also change to match. I
end up with dates from Dec 31 to Jan 30th instead of Jan 1 - Jan 31st. The
other data remains correct and doesn't shift.

Here is the line of code that does the copy:

Workbooks("CheckUp.xls").Worksheets("CURRENT MONTH").Copy

Then I have vba open the SAVE AS dialog so the user can give it the name of
the previous month and save it.
Is there a way to automate naming the copied workbook with the name of the
previous month - ""Jan 07" (just month and year) for example?

fileSaveName = Application.GetSaveAsFilename( fileFilter:="Excel Files
(*.xls), *.xls")
If fileSaveName < False Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=fileSaveName
Application.DisplayAlerts = True

Thanks for any help given. I cetrainly appreciate it.

Jon


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Saving a copied workbook - 2 questions

Check out the 1904 Date System option under Tools options Calculation

It sounds like the option is checked in one workbook and not in the other one.
That will actually change the date by 4 years and 1 day. If you just have
the format to show MM/DD you would not notice the year being off.

I'll have to think about the other part of the question.

David

"jonco" wrote:

I have a workbook that has data for entire month. Date, Sales, Credits,
Debits, Expenses, etc.

At the end of the month when I make a copy of this workbook and paste it to
a new workbook the Date in the first row changed to the previous day (last
day of the previous month). All the other dates also change to match. I
end up with dates from Dec 31 to Jan 30th instead of Jan 1 - Jan 31st. The
other data remains correct and doesn't shift.

Here is the line of code that does the copy:

Workbooks("CheckUp.xls").Worksheets("CURRENT MONTH").Copy

Then I have vba open the SAVE AS dialog so the user can give it the name of
the previous month and save it.
Is there a way to automate naming the copied workbook with the name of the
previous month - ""Jan 07" (just month and year) for example?

fileSaveName = Application.GetSaveAsFilename( fileFilter:="Excel Files
(*.xls), *.xls")
If fileSaveName < False Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=fileSaveName
Application.DisplayAlerts = True

Thanks for any help given. I cetrainly appreciate it.

Jon



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Saving a copied workbook - 2 questions

Workbooks("CheckUp.xls").SaveAs "Jan 07"
'to delete old-named file
Kill "C:\path\CheckUp.xls.xls"

Hth,
Merjet


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Saving a copied workbook - 2 questions

Correction. Last line should have only one ".xls"

Hth,
Merjet

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Saving a copied workbook - 2 questions

The month changes each month.

It won't always be Jan 07. Next month it'll be Feb 07. It needs to get the
date from a cell..... Cell A4 for instance.



Thanks'

Jon

"merjet" wrote in message
oups.com...
Workbooks("CheckUp.xls").SaveAs "Jan 07"
'to delete old-named file
Kill "C:\path\CheckUp.xls.xls"

Hth,
Merjet






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Saving a copied workbook - 2 questions

Workbooks("CheckUp.xls").SaveAs Format(Range("A4"), "mmm yy") & ".xls"

--
David

jonco wrote

The month changes each month.

It won't always be Jan 07. Next month it'll be Feb 07. It needs to get
the date from a cell..... Cell A4 for instance.



Thanks'

Jon

"merjet" wrote in message
oups.com...
Workbooks("CheckUp.xls").SaveAs "Jan 07"
'to delete old-named file
Kill "C:\path\CheckUp.xls.xls"

Hth,
Merjet








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Saving a copied workbook - 2 questions

Thanks for the answers guys. That looks like it will answer my questions.
I DO appreciate the assistance.



"David" wrote in message
...
Workbooks("CheckUp.xls").SaveAs Format(Range("A4"), "mmm yy") & ".xls"

--
David

jonco wrote

The month changes each month.

It won't always be Jan 07. Next month it'll be Feb 07. It needs to get
the date from a cell..... Cell A4 for instance.



Thanks'

Jon

"merjet" wrote in message
oups.com...
Workbooks("CheckUp.xls").SaveAs "Jan 07"
'to delete old-named file
Kill "C:\path\CheckUp.xls.xls"

Hth,
Merjet










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
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
2 Questions, Saving a file from a specific cell value, and Searchi Peter Excel Discussion (Misc queries) 2 April 10th 06 01:54 PM
Saving Posts Questions & Answers In My Computer Enrique Excel Discussion (Misc queries) 3 November 9th 05 09:40 AM
Saving copied info while running a Selection Change Macro J Streger Excel Programming 1 April 5th 05 12:33 AM
Why my cell format is not copied when I copied workbook? courtesio99[_28_] Excel Programming 0 January 9th 04 07:03 AM


All times are GMT +1. The time now is 07:42 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"