ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   saving sheet as new workbook (https://www.excelbanter.com/excel-programming/337072-saving-sheet-new-workbook.html)

Nigel

saving sheet as new workbook
 
Hi,
i have managed to write this which works ok for mt sheet saving as workbook:

Namer = ActiveSheet.Name
Location = "C:\Documents and Settings\myname\Desktop\Invoices"
yearly = Format(Date, "yy")
Dater = Format(Date, "mmmm")
Clienter = Range("B23").Value
detailer = Range("B32").Value

ActiveSheet.Copy
ActiveWorkbook.SaveAs Location & "\" & Dater & " " & yearly & "\" & Namer &
" " & Clienter & " " & detailer

however, i need it to save in the month folder as specified on the onvoice
date but currently it is taking the month of today and searching for that
folder. Can i take the cell data , range("H14"), and format the value to
month only to get the variable to search for the month only??

thanks, Nigel


Dave Peterson

saving sheet as new workbook
 
Is it Dater that's the problem?

maybe you can use:

Dater = Format(activesheet.range("h14").value, "mmmm")

to get that month.

Nigel wrote:

Hi,
i have managed to write this which works ok for mt sheet saving as workbook:

Namer = ActiveSheet.Name
Location = "C:\Documents and Settings\myname\Desktop\Invoices"
yearly = Format(Date, "yy")
Dater = Format(Date, "mmmm")
Clienter = Range("B23").Value
detailer = Range("B32").Value

ActiveSheet.Copy
ActiveWorkbook.SaveAs Location & "\" & Dater & " " & yearly & "\" & Namer &
" " & Clienter & " " & detailer

however, i need it to save in the month folder as specified on the onvoice
date but currently it is taking the month of today and searching for that
folder. Can i take the cell data , range("H14"), and format the value to
month only to get the variable to search for the month only??

thanks, Nigel


--

Dave Peterson


All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com