-
August 7th, 2013, 03:00 AM
#1
change of seperator when using SaveAs, instead of 07/08/13 it needs to be 07.08.13
Good morning all,
I have a small programme running which requires the form to be saved after completion. It needs to be saved just by date and time, so using the following code
Code:
Application.Dialogs(xlDialogSaveAs). Show Now()
The only problem is that when the date and time are saved they have seperators which will not save ie. 07/08/13 09:01:30. I need to be able to change this to
07.08.13 09.01.30. Could somebody please show me how to do this.
Many thanks
Robbosan
-
August 7th, 2013, 10:35 AM
#2
Re: change of seperator when using SaveAs, instead of 07/08/13 it needs to be 07.08.1
This might work for you :
http://www.vb6.us/tutorials/formatin...-and-times-vb6
Although it is not separated with dots, but I think you'll get the idea
-
August 8th, 2013, 04:40 PM
#3
Re: change of seperator when using SaveAs, instead of 07/08/13 it needs to be 07.08.1
You may be able to use Replace() as well
Code:
Dim AlteredDate as String
AlteredDate=Replace(Now(), "/", ".")
Msgbox AlteredDate
The same can work for any character it this case you would need to use it more than once
Last edited by DataMiser; August 8th, 2013 at 04:42 PM.
Always use [code][/code] tags when posting code.
-
August 14th, 2013, 08:43 AM
#4
Re: change of seperator when using SaveAs, instead of 07/08/13 it needs to be 07.08.1
Sorry for the delay in reply had to go away for afew days with work.
Many thanks for that it is a good reference point to begin with.
Best regards
Robbosan
-
August 14th, 2013, 08:44 AM
#5
Re: change of seperator when using SaveAs, instead of 07/08/13 it needs to be 07.08.1
Sorry for the delay in reply had to go away for a few days with work.
Many thanks for that it cetainly worked for my problem.
Best regards
Robbosan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|