#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Date format

I am trying to save a file with the date in some other format other than
10/3/06
as this will not allow me to save because of the forward slashs. It tried
changing the format in the input cell but still reverts to the forward slashes

jobdate = Range("D7")

jobnumber = InputBox("Please enter TIME SHEET file name to save", " Process
Technology", "C:\My Documents\" & jobnumber + " " + jobemployee + " " +
jobdate)

Thanks in advance

oldjay
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Date format


Try Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

Alan


Oldjay wrote:
I am trying to save a file with the date in some other format other than
10/3/06
as this will not allow me to save because of the forward slashs. It tried
changing the format in the input cell but still reverts to the forward slashes

jobdate = Range("D7")

jobnumber = InputBox("Please enter TIME SHEET file name to save", " Process
Technology", "C:\My Documents\" & jobnumber + " " + jobemployee + " " +
jobdate)

Thanks in advance

oldjay


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Date format

I put the following

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\My Documents\" & jobnumber + " " +
jobemployee + " " + Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

I get a compile error

" wrote:


Try Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

Alan


Oldjay wrote:
I am trying to save a file with the date in some other format other than
10/3/06
as this will not allow me to save because of the forward slashs. It tried
changing the format in the input cell but still reverts to the forward slashes

jobdate = Range("D7")

jobnumber = InputBox("Please enter TIME SHEET file name to save", " Process
Technology", "C:\My Documents\" & jobnumber + " " + jobemployee + " " +
jobdate)

Thanks in advance

oldjay



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Date format

Add this to your code and use your code as posted.

Dim Jobdate As String
Jobdate = Range("D7").Value
Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" & Year(Jobdate)

Oldjay wrote:
I put the following

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\My Documents\" & jobnumber + " " +
jobemployee + " " + Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

I get a compile error

" wrote:


Try Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

Alan


Oldjay wrote:
I am trying to save a file with the date in some other format other than
10/3/06
as this will not allow me to save because of the forward slashs. It tried
changing the format in the input cell but still reverts to the forward slashes

jobdate = Range("D7")

jobnumber = InputBox("Please enter TIME SHEET file name to save", " Process
Technology", "C:\My Documents\" & jobnumber + " " + jobemployee + " " +
jobdate)

Thanks in advance

oldjay




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Date format

Get error 1004 when it tries to save "JobSave" who's value is

"C:\My Documents\1234 Jonn Vandiver 10-2-2006"

Here is the entire macro

oldjay

Private Sub CommandButton4_Click() 'Save time sheet
Dim jobname As String
Dim jobemployee As String
Dim Jobdate As String
Dim jobnumber As String
Dim jobsave As String

Jobdate = Range("D7").Value
Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" &
Year(Jobdate)
jobname = Range("D4")
jobemployee = Range("D2")
jobnumber = Range("D5")

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\My Documents\" & jobnumber + " " +
jobemployee + " " + (Jobdate))
jobsave = jobnumber & ".XLS"
If jobnumber = "" Then
Range("D1").Select
Range("D3").Select

Else

ActiveWorkbook.SaveAs Filename:=jobsave
ActiveWorkbook.Close
Windows("Process Tech Time Sheet Database.XLS").Activate
Range("D1").Select
Range("D3").Select
End If
End Sub

" wrote:

Add this to your code and use your code as posted.

Dim Jobdate As String
Jobdate = Range("D7").Value
Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" & Year(Jobdate)

Oldjay wrote:
I put the following

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\My Documents\" & jobnumber + " " +
jobemployee + " " + Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

I get a compile error

" wrote:


Try Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

Alan


Oldjay wrote:
I am trying to save a file with the date in some other format other than
10/3/06
as this will not allow me to save because of the forward slashs. It tried
changing the format in the input cell but still reverts to the forward slashes

jobdate = Range("D7")

jobnumber = InputBox("Please enter TIME SHEET file name to save", " Process
Technology", "C:\My Documents\" & jobnumber + " " + jobemployee + " " +
jobdate)

Thanks in advance

oldjay






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Date format

On my machine it is breaking on the line:

ActiveWorkbook.SaveAs Filename:=jobsave

"C:\My Documents" directory does not exist on my computer. When I
change jobnumber to point to the temp directory, your macro works.
Does this directory exist on your computer? Will it exist on user's
computers? There are other method of pointing to the My Documents
folder on a given computer.

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\Temp\" & jobnumber + " " +
jobemployee + " " + (Jobdate))


I also got an error due to JobDate being set as a string variable. Dim
as Variant should fix that.



Oldjay wrote:
Get error 1004 when it tries to save "JobSave" who's value is

"C:\My Documents\1234 Jonn Vandiver 10-2-2006"

Here is the entire macro

oldjay

Private Sub CommandButton4_Click() 'Save time sheet
Dim jobname As String
Dim jobemployee As String
Dim Jobdate As String
Dim jobnumber As String
Dim jobsave As String

Jobdate = Range("D7").Value
Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" &
Year(Jobdate)
jobname = Range("D4")
jobemployee = Range("D2")
jobnumber = Range("D5")

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\My Documents\" & jobnumber + " " +
jobemployee + " " + (Jobdate))
jobsave = jobnumber & ".XLS"
If jobnumber = "" Then
Range("D1").Select
Range("D3").Select

Else

ActiveWorkbook.SaveAs Filename:=jobsave
ActiveWorkbook.Close
Windows("Process Tech Time Sheet Database.XLS").Activate
Range("D1").Select
Range("D3").Select
End If
End Sub

" wrote:

Add this to your code and use your code as posted.

Dim Jobdate As String
Jobdate = Range("D7").Value
Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" & Year(Jobdate)

Oldjay wrote:
I put the following

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\My Documents\" & jobnumber + " " +
jobemployee + " " + Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

I get a compile error

" wrote:


Try Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

Alan


Oldjay wrote:
I am trying to save a file with the date in some other format other than
10/3/06
as this will not allow me to save because of the forward slashs. It tried
changing the format in the input cell but still reverts to the forward slashes

jobdate = Range("D7")

jobnumber = InputBox("Please enter TIME SHEET file name to save", " Process
Technology", "C:\My Documents\" & jobnumber + " " + jobemployee + " " +
jobdate)

Thanks in advance

oldjay





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Date format

You are right - I should not have used "C:\. I always assumed that "My
Documents" was in the C drive. Dummy! All I had to do is look in the folder
tree to see that.

thanks

oldjay


" wrote:

On my machine it is breaking on the line:

ActiveWorkbook.SaveAs Filename:=jobsave

"C:\My Documents" directory does not exist on my computer. When I
change jobnumber to point to the temp directory, your macro works.
Does this directory exist on your computer? Will it exist on user's
computers? There are other method of pointing to the My Documents
folder on a given computer.

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\Temp\" & jobnumber + " " +
jobemployee + " " + (Jobdate))


I also got an error due to JobDate being set as a string variable. Dim
as Variant should fix that.



Oldjay wrote:
Get error 1004 when it tries to save "JobSave" who's value is

"C:\My Documents\1234 Jonn Vandiver 10-2-2006"

Here is the entire macro

oldjay

Private Sub CommandButton4_Click() 'Save time sheet
Dim jobname As String
Dim jobemployee As String
Dim Jobdate As String
Dim jobnumber As String
Dim jobsave As String

Jobdate = Range("D7").Value
Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" &
Year(Jobdate)
jobname = Range("D4")
jobemployee = Range("D2")
jobnumber = Range("D5")

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\My Documents\" & jobnumber + " " +
jobemployee + " " + (Jobdate))
jobsave = jobnumber & ".XLS"
If jobnumber = "" Then
Range("D1").Select
Range("D3").Select

Else

ActiveWorkbook.SaveAs Filename:=jobsave
ActiveWorkbook.Close
Windows("Process Tech Time Sheet Database.XLS").Activate
Range("D1").Select
Range("D3").Select
End If
End Sub

" wrote:

Add this to your code and use your code as posted.

Dim Jobdate As String
Jobdate = Range("D7").Value
Jobdate = Month(Jobdate) & "-" & Day(Jobdate) & "-" & Year(Jobdate)

Oldjay wrote:
I put the following

jobnumber = InputBox("Please enter TIME SHEET file name to
save", " Process Technology", "C:\My Documents\" & jobnumber + " " +
jobemployee + " " + Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

I get a compile error

" wrote:


Try Month(Jobdate) & "-" & Day(jobdate) & "-" & year(jobdate)

Alan


Oldjay wrote:
I am trying to save a file with the date in some other format other than
10/3/06
as this will not allow me to save because of the forward slashs. It tried
changing the format in the input cell but still reverts to the forward slashes

jobdate = Range("D7")

jobnumber = InputBox("Please enter TIME SHEET file name to save", " Process
Technology", "C:\My Documents\" & jobnumber + " " + jobemployee + " " +
jobdate)

Thanks in advance

oldjay






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
permanent conversion of 1904 date format to 1900 date format Jos Excel Worksheet Functions 4 November 26th 15 02:48 PM
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 PM
Excel 2000 date format cannot be set to Australian date format Brian Jones Excel Discussion (Misc queries) 1 March 30th 05 06:03 AM
code to convert date from TEXT format (03-02) to DATE format (200203) Gauthier[_2_] Excel Programming 0 September 22nd 04 03:26 PM
Change a date in text format xx.xx.20xx to a recognised date format concatenator Excel Programming 1 November 24th 03 11:33 PM


All times are GMT +1. The time now is 08:18 AM.

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"