Z
Zeke XA3
Hi there,
I have recently started a new job and trying to do some extra work t
get ahead. I have taken on some spreadsheet development and have bee
learning some basic macro and VBA details. I have just completed m
first Userform spreadsheet for my co-workers to enter details onto
spreadsheet in a nice uniform manner. However my next project is a bi
beyond what i have been able to teach myself.
I am trying to create a table for my co-workers to record day they ar
able to do overtime.
This will have the date along the top a row, and their names in
column. What i would like is for a user box in which they would ente
their name and date. At which point the VBA script would search th
column for their name and then the row for the date and in the cel
where they intersect insert a text (ie Overtime).
I have managed to find this bit of code on a forum that will search
column and allow me to put in available or not available for overtim
now I just need to add in the bit where it searches across for the dat
as well.
Code:
Code
-------------------
Sub Find_UserID()
Dim ThisCell As Range
Dim LookupValue As String
Dim SearchRange As Range
Set SearchRange = Sheets("Sheet1").Range("A1:A" & Sheets("Sheet1").Range("A65536").End(xlUp).Row)
LookupValue = Application.InputBox("What is the name of the person requesting Overtime?", "Person Lookup", , , , , , 2)
For Each ThisCell In SearchRange
If UCase(ThisCell.Value) = UCase(LookupValue) Then
Sheets("Sheet1").Range("B" & ThisCell.Row).Value = Application.InputBox("Avliable or Not?", "Enter text")
Exit Sub
End If
Next ThisCell
MsgBox LookupValue & " was not found!", vbOKOnly + vbCritical, LookupValue & " Not Found"
End Sub
-------------------
Any help in explaining how i can get it to search the row befor
submitting the application.inputbox value would be greatl
appreciated.
I have recently started a new job and trying to do some extra work t
get ahead. I have taken on some spreadsheet development and have bee
learning some basic macro and VBA details. I have just completed m
first Userform spreadsheet for my co-workers to enter details onto
spreadsheet in a nice uniform manner. However my next project is a bi
beyond what i have been able to teach myself.
I am trying to create a table for my co-workers to record day they ar
able to do overtime.
This will have the date along the top a row, and their names in
column. What i would like is for a user box in which they would ente
their name and date. At which point the VBA script would search th
column for their name and then the row for the date and in the cel
where they intersect insert a text (ie Overtime).
I have managed to find this bit of code on a forum that will search
column and allow me to put in available or not available for overtim
now I just need to add in the bit where it searches across for the dat
as well.
Code:
Code
-------------------
Sub Find_UserID()
Dim ThisCell As Range
Dim LookupValue As String
Dim SearchRange As Range
Set SearchRange = Sheets("Sheet1").Range("A1:A" & Sheets("Sheet1").Range("A65536").End(xlUp).Row)
LookupValue = Application.InputBox("What is the name of the person requesting Overtime?", "Person Lookup", , , , , , 2)
For Each ThisCell In SearchRange
If UCase(ThisCell.Value) = UCase(LookupValue) Then
Sheets("Sheet1").Range("B" & ThisCell.Row).Value = Application.InputBox("Avliable or Not?", "Enter text")
Exit Sub
End If
Next ThisCell
MsgBox LookupValue & " was not found!", vbOKOnly + vbCritical, LookupValue & " Not Found"
End Sub
-------------------
Any help in explaining how i can get it to search the row befor
submitting the application.inputbox value would be greatl
appreciated.