Forgive me if I am too much of a noobie for this to work, or even make any sense. I'm working on making a database for myself and a friend of mine to use. (These would be two different databases not merged at all.) I'm not starting from scratch so that might be one of my problems. I'm using my work hours sheet (Don't worry, it's just a copy) to "learn/test" what I want to do with VBA. Basically what I want to do is to take the information (value?) of the cells "A3:D3" & "E2" and put those values into their corresponding columns. But I don't want it to over-right code inside the next cell. That's why I put in line 10 and 11. It still doesn't like it.
Also, I was wondering if I could get help on this...And if the information could possibly be date sensitive? i.e. You type in today's hours and remembered you forgot to log yesterday's hours so you type what the date was in the "DateToday" or A3 box and it logs the information in a row dedicated to that date, OR you skip two days of work and you put the date in and VBA skips two rows?
Are these two different requests? And are either possible? Any help is MUCH appreciated!! Thank you in advance!
Private Sub CommandButton1_Click()
Dim DateToday As Date, TimeIn As Integer, LunchLength As Integer, TimeOut As Integer, HoursToday As Integer
Worksheets("sheet1").Select
DateToday = Range("A3")
TimeIn = Range("B3")
LunchLength = Range("C3")
TimeOut = Range("D3")
HoursToday = Range("E2")
Worksheets("sheet1").Range("A141").Select
If Worksheets("sheet1").Range("A141").Offset(1, 0) <> "" Then
Worksheets("sheet1").Range("A141").End(x1Down).Select
End If
ActiveCell.Value = TimeIn
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = LunchLength
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = TimeOut
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = HoursToday
Worksheets("sheet1").Range("B2:D2").ClearContents
ThisWorkbook.Save
Worksheets("sheet1").Range("B2").Select
End Sub
The last section there "Worksheets("sheet1").Range("B2").Select
" is more for my second project but would be nice for this too. The second project would be much like this one except me and my friend will be entering part numbers, definitions, part condition, and other stuff. Once again, ANY help is MUCH appreciated!