skydive1981
06-30-2005, 04:39 AM
Hello all,
I have a query -
I am making a workbook to record my staff's overtime requests. What I want to do is add each request by clicking abutton and then filling in some info. I also want this button click to check another list for the requestors name. If the requestors name is NOT already in the list I want it to be added (this is to toal up each employee's overtime). I am stuck on the adding the the table bit! The code I am using up to now is below. Can anyone help me with what to do next?
Thanks
Private Sub butRequest1_Click()
Dim jlgName
Dim jlgDate As Date
Dim jlgJust As String
Dim jlgVerified
Dim jlgSubmitted
Dim jlgSetA As Range
Dim jlgCompany
Dim jlgHours As Integer
With ActiveSheet
jlgName = InputBox("Name of Agent:", "Agent", "")
jlgCompany = InputBox("Is the agent staff or agency?:")
jlgDate = InputBox("Enter date of overtime:", "Date", "")
jlgJust = InputBox("What is the agents justification?:", "Justification", "")
jlgHours = InputBox("How many hours?:", "Hours", "")
Set jlgSetA = Range("b14:b100").Find(what:="")
If jlgSetA Is Nothing Then MsgBox ("No Space")
jlgSetA = jlgDate
jlgSetA.Offset(columnOffset:=1) = jlgCompany
jlgSetA.Offset(columnOffset:=2) = jlgName
jlgSetA.Offset(columnOffset:=3) = jlgJust
jlgSetA.Offset(columnOffset:=4) = jlgHours
End With
End SubAdded vb tags. Click 'Reply' on this post if you want to see how they work, or read all about tags here (www.xtremevbtalk.com/misc.php?do=bbcode).
Also, indentation makes your code a lot easier to read.
I have a query -
I am making a workbook to record my staff's overtime requests. What I want to do is add each request by clicking abutton and then filling in some info. I also want this button click to check another list for the requestors name. If the requestors name is NOT already in the list I want it to be added (this is to toal up each employee's overtime). I am stuck on the adding the the table bit! The code I am using up to now is below. Can anyone help me with what to do next?
Thanks
Private Sub butRequest1_Click()
Dim jlgName
Dim jlgDate As Date
Dim jlgJust As String
Dim jlgVerified
Dim jlgSubmitted
Dim jlgSetA As Range
Dim jlgCompany
Dim jlgHours As Integer
With ActiveSheet
jlgName = InputBox("Name of Agent:", "Agent", "")
jlgCompany = InputBox("Is the agent staff or agency?:")
jlgDate = InputBox("Enter date of overtime:", "Date", "")
jlgJust = InputBox("What is the agents justification?:", "Justification", "")
jlgHours = InputBox("How many hours?:", "Hours", "")
Set jlgSetA = Range("b14:b100").Find(what:="")
If jlgSetA Is Nothing Then MsgBox ("No Space")
jlgSetA = jlgDate
jlgSetA.Offset(columnOffset:=1) = jlgCompany
jlgSetA.Offset(columnOffset:=2) = jlgName
jlgSetA.Offset(columnOffset:=3) = jlgJust
jlgSetA.Offset(columnOffset:=4) = jlgHours
End With
End SubAdded vb tags. Click 'Reply' on this post if you want to see how they work, or read all about tags here (www.xtremevbtalk.com/misc.php?do=bbcode).
Also, indentation makes your code a lot easier to read.