Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Find the next one

Hi All,

The following is code I have been provided with before and I
manipulate it to use it for many differant projects, I think most of
the credit should go to Tom Ogilvy.

Anyway, this time I am trying to manipulate it to use for a button
that marks a cell as "Technician not Available", so that i can go on
to find the next available technician.

Now the trouble is that the technician names are repeated over and
over, running down column A, at the moment it works perfectly but when
the name is duplicated it doesnt go any further, I want it so that if
there is already something in B column next to the technician it has
found I want it to go the next occurance down with empty B column and
put "Technician not Available" there.

I hope that makes sense, any help would be much appreciated, I have
pasted the code thus far so you can see what I am working with, I am
sure it is an easy task to do this find next procedure but I really
dont have an idea where to start and searching the groups hasnt
provided an answer bespoke enough for my small mind to manipulate!


Private Sub NotUser_Click()
With Sheets(Team.Value).Range("A1:A64000")
Dim oCell As Range
Dim wks As Worksheet
Dim strAddress As String
Dim FindWhat As String
Dim hawb As String
Sheets(Team.Value).Select
hawb = Individual.Value
FindWhat = hawb
If FindWhat <= "" Then
Exit Sub
Else
With Sheets(Team.Value).Range("A1:A64000")
Set oCell = .Find(What:=FindWhat, LookIn:=xlFormulas,
_
Lookat:=xlPart, SearchOrder:=xlByRows,
_
SearchDirection:=xlNext, _
MatchCase:=False)
If oCell Is Nothing Then
MsgBox "Error:-NotFound" & vbCrLf & vbCrLf &
"Maybe Technician not part of this Team?"
Exit Sub
Else
strAddress = oCell.Address(External:=True)
hawb2 = oCell.Offset(0, 1).Address
Range(hawb2).Value = "Technician not Available"
End If
End With
End If
End With
Call Team_Change
End Sub

Many thanks in advance, Any help at all would be most appreciated.

Duncan

Reply
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
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Despite data existing in Excel 2002 spreadsheet Find doesn't find AnnieB Excel Discussion (Misc queries) 1 June 16th 06 02:15 AM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 06:58 PM.

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

About Us

"It's about Microsoft Excel"