|
-
Apr 9th, 2005, 08:14 AM
#1
Thread Starter
New Member
StripSlashes from Date Function?
Hi guys, Just trying to setup an application that will log in data I store in it per day. I have a main data sheet, a front page with functions / macros / forms etc for easy data entry and I am having a bit of trouble seperating the days in my data sheet.
What I have decided to do which seems very easy once I can get past this is to create arrays / tables / groupings for each day.... The code that I have created so far is :
Rows("7:7").Select
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
ActiveWorkbook.Names.Add Name:=Date, RefersToR1C1:="=Data!R6:R8"
What this does is give the day a bit of seperation from other days and then creates a table/array from the days. The data entry form adds rows at 7 so this array grows with each piece of data that is added into it.... The only problem with this is that the Name wont accept "/" so when inserting Date it comes up with "This is not allowed" error. Is there a way I can make Date into just alphanumeric without these "/" ? Or would I have to say insert Date into A1 and then use a function to strip slashes in A2 and then just use the value in A2 ?
--------------------------------------------------------------------------------
I will upload what I have done...
What I am planning to do is when a table is opened, I plan to use something like DateTime.Now instead of having to input it manually but that is later on.
For now I would like the "Start New Day" Form, when clicking on the Command Button "Yes" to create the array and name it by the date of the day. That way when I finish the day late I can work out totals from the array.
The work I have done so far can be found at this link:
http://www.dowr.com/PokerLog.xls
-
Apr 9th, 2005, 02:12 PM
#2
Hyperactive Member
Re: StripSlashes from Date Function?
...you can do anything with dates...BUT some of your custom formatting may not be recognized as a date by (Dim as Date) and excel...your best 'bet' (haha) is to just check out date and format functions in the excel VBE help menu...tons of them...
VB Code:
MsgBox Replace(Now, "/", "")
MsgBox Replace(Now, "/", "<><>")
MsgBox DatePart("d", Now)
MsgBox DatePart("m", Now)
MsgBox DatePart("yyyy", Now)
MsgBox Format(Now, "hh:mm dd'mmm'yy")
MsgBox Format(Now, "hh:mm dd-mmm-yy")
MsgBox Format(Now, "dddd")
-
Apr 10th, 2005, 04:30 PM
#3
Thread Starter
New Member
Re: StripSlashes from Date Function?
Hi there have you got MSN or some email so I can speak with you further? I am really new to this (apart from an A level project) but that was just simple ----> mediocre VBa usage.
Just wondering if you could be more specific and fit the code into what I have already done?
-
Apr 10th, 2005, 11:39 PM
#4
Hyperactive Member
Re: StripSlashes from Date Function?
glad to help you with taking a date and changing into a different format, extract quanties, create , time zone diff...stuff like that ...
-
Apr 11th, 2005, 03:08 AM
#5
Re: StripSlashes from Date Function?
Perhaps a sily question but why are you using Excel for this instead of Access (for learning) or someother db for larger implementations?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
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
|