Hi All,
my apologies for bothering you all again, but after a few days of struggling to find a way to pull data from a row into a userform based on a search value being found in column A, I've decided it may be easier to unlock just a single row for editing based on that search value..but is this even possible??
here's the search code i use to search for a demand (value kept in column A)
this locates the demand number, and takes the user to it and works well, but can it also be used to unlock the row (from 'A' to 'P') containing the value found in column A??
your help is greatly appreciated.
my apologies for bothering you all again, but after a few days of struggling to find a way to pull data from a row into a userform based on a search value being found in column A, I've decided it may be easier to unlock just a single row for editing based on that search value..but is this even possible??
here's the search code i use to search for a demand (value kept in column A)
Code:
Sub Find_Button()
Dim datatoFind
Dim sheetCount As Integer
Dim counter As Integer
Dim currentSheet As Integer
On Error Resume Next
currentSheet = ActiveSheet.Index
datatoFind = InputBox("Please enter your search:")
If datatoFind = "" Then Exit Sub
sheetCount = ActiveWorkbook.Sheets.Count
If IsError(CDbl(datatoFind)) = False Then datatoFind = CDbl(datatoFind)
For counter = 1 To sheetCount
Sheets(counter).Activate
Cells.Find(What:=datatoFind, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlColumns, SearchDirection:=xlNext, MatchCase:= _
False).Activate
If ActiveCell.Value = datatoFind Then Exit Sub
Next counter
If ActiveCell.Value <> datatoFind Then
msgbox ("The search returned no hits.")
Sheets(currentSheet).Activate
End If
End Sub
this locates the demand number, and takes the user to it and works well, but can it also be used to unlock the row (from 'A' to 'P') containing the value found in column A??
your help is greatly appreciated.