Solved

Work book and vba

Posted on 2015-02-06
8
42 Views
Last Modified: 2016-02-10
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
0
Comment
Question by:bjfulkerson
  • 3
  • 3
  • 2
8 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
Comment Utility
a. It's because you are using this syntax:

.Cells(lastrow + 1, "A")

it should be

.Cells(lastrow + 1, 1)
0
 
LVL 24

Expert Comment

by:Phillip Burton
Comment Utility
b. See row 35 and 36 for example.

I can't do so - you haven't attached anything.
0
 
LVL 45

Accepted Solution

by:
Martin Liss earned 500 total points
Comment Utility
I couldn't reproduce the ADD error. All the changes are marked with
'new

Open in new window

Q-28611711.xlsm
0
 
LVL 24

Expert Comment

by:Phillip Burton
Comment Utility
a. Scratch my comment - I'm surprised it works, but it does.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
a. Scratch my comment - I'm surprised it works, but it does.
I was too.
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
@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
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
The workbook came from this question and the author forgot to post the workbook here.
0
 
LVL 29

Expert Comment

by:gowflow
Comment Utility
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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This is an Add-On procedure to be used in conjunction with the code provided in Reducing EE Email Clutter using Outlook (http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/A_3146-Outlook-Processing-EE-emails-on-Receive.…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now