cityanangelstx2004
Board Regular
- Joined
- Jun 18, 2004
- Messages
- 56
This is a two part question. I am working on a timesheet and I want to do the following.
A1 IN
B1 OUT
C1 IN
D1 OUT
E1 TOTAL
A2 8:00 am
B2 10:00 am
C2 11:00 am
D2 5:00 pm
E2 =((D4-A4+(D4 < A4))-(C4-B4+(C4 < B4)))*24
1. Is it possible using VBA to restrict a cell to only accept a date format and anything else would popup a message? So if someone entered a straight number 8 or text only then a message would appear and undo the incorrect entry.
2. How do you specify a formula for a specific cell using VBA? I know I can simply enter the code into the cell as referenced above, but I prefer to have that formula "=((D4-A4+(D4 < A4))-(C4-B4+(C4 < B4)))*24" be referenced for an entire range(e2:e14).
I appreciate any help on this subject. Thank you in advance.
A1 IN
B1 OUT
C1 IN
D1 OUT
E1 TOTAL
A2 8:00 am
B2 10:00 am
C2 11:00 am
D2 5:00 pm
E2 =((D4-A4+(D4 < A4))-(C4-B4+(C4 < B4)))*24
1. Is it possible using VBA to restrict a cell to only accept a date format and anything else would popup a message? So if someone entered a straight number 8 or text only then a message would appear and undo the incorrect entry.
2. How do you specify a formula for a specific cell using VBA? I know I can simply enter the code into the cell as referenced above, but I prefer to have that formula "=((D4-A4+(D4 < A4))-(C4-B4+(C4 < B4)))*24" be referenced for an entire range(e2:e14).
I appreciate any help on this subject. Thank you in advance.