Question : .find column search returning

Hi all,

Hopefuly an easy one.

basically what I am trying to do i run a cacualtion formula so that when any of the set cells are changed we recalculate the costs.

now the costs are held on a seperate sheet, and so have written a funtion to return the row of the correct product. howevere I am getting a type mismatc in my search function

basically I want to search column b of the worksheet.

howevere whenever I try and use the function it is erroring. can anyone tell me what i am doing wrong?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
'change cell event macro
Private Sub Worksheet_Change(ByVal Target As Range)

Dim rng As Range

With Sheets("Pricing")
   Set rng = Range(.Cells("3", "D"), .Cells("17", "D")) 'note leading periods/fullstops
End With

If Not Intersect(rng, Target) Is Nothing Then
   Call OverlapCalculator
   Call CalculateDrops
   Call CalculatePrice
End If

End Sub

Function getPVCRow()

    Dim pvc As String
    pvc = Worksheets("Pricing").Range("D8").Value
    
    If pvc = "" Then
        MsgBox ("Please select a PVC type before continuing")
    End If
    
    'got value now we need to find the right bracket and the number of notches associated with this
    'first find the value in the B column
    getPVCRow = Worksheets("Costs").Columns(2).Cells.Find(what:=pvc, After:=ActiveCell, LookIn:=xlValues, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False).Row
    

End Function

Sub OverlapCalculator()
'
' OverlapCalculator Macro
'
' First of all we need to find out strip width from the selected dropdown box
' Next we need to then check the number of notches on the bracket
' Finally we can calculate and add the values to the dropdown

    Dim selectedrow As Integer
    selectedrow = getPVCRow

Answer : .find column search returning

Just because the motherboard lights are no dose not mean that the power is fine.

I would subject testing with a different PSU
Random Solutions  
 
programming4us programming4us