# Off Topic > Hello..Introduce yourself >  >  insert cell value from row column text intersect with userform

## Gabriel Ribeiro

Hello,

I am trying to use a userform to automatically insert price quote for different products of different suppliers in sheet 2 (quotation) - for various products and suppliers... 
quota.jpg

I also have a label that looks up the previous value for that cell reference so I can check what was the value before the price update... So far I found the following code that suits well for my needs to only insert the new price but not automatic... I though the userform was the right way to go but just cant figure it out how to do it... Any help would be greatly appreciated - Thanks!

Cell A1 - Blank

A2:A - product list
B1:XDO1 - supplier list

Public Sub FindWithArray()
Dim rng As Range

' To store the targe fornecedor index
Dim colArray(10) As Integer

' To store the targe insumo index
Dim rowArray(10) As Integer

' Store the First value for Find & FindNext
Dim firstAddress As String

Dim i As Integer
Dim j As Integer
i = 0
j = 0
Sheet2.Activate
With Range("B1:xd1")
    Set rng = .Find("alfamec", LookIn:=xlValues)
    If Not rng Is Nothing Then
        firstAddress = rng.Address

        Do
            Set rng = .FindNext(rng)
            colArray(i) = rng.Column
            i = i + 1

        Loop While Not rng Is Nothing And rng.Address <> firstAddress
    End If
End With

With Range("A2:A2000")
    Set rng = .Find("abacaxi", LookIn:=xlValues)
    If Not rng Is Nothing Then
        firstAddress = rng.Address

        Do
            Set rng = .FindNext(rng)
            rowArray(j) = rng.Row
            j = j + 1

        Loop While Not rng Is Nothing And rng.Address <> firstAddress
    End If
End With

Dim c As Integer
Dim r As Integer

For c = 0 To i - 1
    For r = 0 To j - 1
        Cells(rowArray(r), colArray(c)).Value = "R$7"
    Next r
Next c

End Sub

----------


## arlu1201

Hello Gabriel Ribeiro, 

Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.

----------

