LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Script to search for a specific cell - Help needed


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.

--
Zeke XA
-----------------------------------------------------------------------
Zeke XA3's Profile: http://www.excelforum.com/member.php...fo&userid=3606
View this thread: http://www.excelforum.com/showthread.php?threadid=55851

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search a cell for a specific number mpenkala Excel Worksheet Functions 5 September 24th 08 08:51 PM
Search for record with specific name in a cell pomalley Excel Worksheet Functions 2 November 17th 05 02:44 PM
How do I search for specific text and sum the cell to the right? PacRat2001 Excel Worksheet Functions 3 October 12th 05 04:21 AM
search column for specific cell using vba dave91 Excel Programming 1 July 30th 05 05:59 PM
Help Needed to Search and Find Specific Data Paul Black Excel Programming 5 August 1st 04 10:41 PM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"