Work book and vba

This is a timesheet entry and employee update doc to track productivity.

1.      I would like the cursor to start in the INITIALS box.  Currently, when the initials are entered it auto pops the FNAME, LNAME, STATUS and HDEPT.
a.      I would like the cursor to jump to the FUNCTION CODE box and using the tab to the A#, TIME, UNITS, ADD button.
b.      After pressing enter when the ADD button is active, can the A# box be cleared?
2.      All this data updates the Timesheet Tab
a.      When I ADD, I get an error
 Runtime error 424
the debugger highlights     .Cells(lastrow + 1, "G").Value = TxtUPH.Text


Private Sub ccmdAdd_Click()
   Dim lastrow As Long
   
   With Sheets("Timesheet")
     lastrow = .Range("A1048576").End(xlUp).Row
    'lastrow = Sheets("Timesheet").Range("A2").End(xlDown).Row
    .Cells(lastrow + 1, "A").Value = ComboBox1.Text
    .Cells(lastrow + 1, "B").Value = TxtDate.Text
    .Cells(lastrow + 1, "C").Value = CB2FunctionCode.Text
    .Cells(lastrow + 1, "D").Value = TxtA.Text
    .Cells(lastrow + 1, "E").Value = TxtTime.Text
    .Cells(lastrow + 1, "F").Value = TxtUnits.Text
    .Cells(lastrow + 1, "G").Value = TxtUPH.Text
    .Cells(lastrow + 1, "H").Value = TxtFname.Text
    .Cells(lastrow + 1, "I").Value = TxtLName.Text
    .Cells(lastrow + 1, "J").Value = TxtHDept.Text
   
   End With
 
 End Sub
 
b.      When I enter a new line item through the TIME SHEET ENRTY it removes the functions that are in place.  I have a VLOOKUP function in the DESCRIPTION column to add the description by the code entered and in UNITSperHR.  It doesn’t update the rest of the information LNAME, FNAME and HDEPT.  See row 35 and 36 for example.
Thanks for your time

Jody
bjfulkersonAsked:
Who is Participating?
 
Martin LissConnect With a Mentor Older than dirtCommented:
I couldn't reproduce the ADD error. All the changes are marked with
'new

Open in new window

Q-28611711.xlsm
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
a. It's because you are using this syntax:

.Cells(lastrow + 1, "A")

it should be

.Cells(lastrow + 1, 1)
0
 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
b. See row 35 and 36 for example.

I can't do so - you haven't attached anything.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
a. Scratch my comment - I'm surprised it works, but it does.
0
 
Martin LissOlder than dirtCommented:
a. Scratch my comment - I'm surprised it works, but it does.
I was too.
0
 
gowflowCommented:
@Martin Liss
Just a question how come you posted a file that have tables and sheets and seems it is OP file that was not neither posted in this question nor there is a link to previous question ?

Kindly clarify
gowflow
0
 
Martin LissOlder than dirtCommented:
The workbook came from this question and the author forgot to post the workbook here.
0
 
gowflowCommented:
Ahhh ic you had worked on it before and this is continuation !!! mmm good as for 1 minute I though there was voodoo around here and some telepathic going around got you to get the file !!
So I'll leave you to handle this as sure in good hand !

gowflow
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.