Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88030

How to insert data from userform to a specific row with a specific value

$
0
0

I want to create a userform that can find the "Sales" value in column E and then input the remaining data to the same row.

Set APAC = Sheet2
APAC.Activate
Range("E18:E1888").Select
For Each D In Selection
    If D.Value = "TWO.Sales.Value" Then
        Exit For
    End If
Next D


Rows(D.Row).Select

    D.Offset(0, 2).Value = TWO.RSA.Value
    D.Offset(0, 3).Value = TWO.Part.Value
    D.Offset(0, 4).Value = Application.WorksheetFunction.VLookup(TWO.Part.Value, Worksheets("DataEntry").Range("T2:U70").Value, 2, False)
    D.Offset(0, 5).Value = TWO.Program.Value
    D.Offset(0, 6).Value = TWO.QTY.Value
    Sheet2.Activate

This is my code but

run time error '91'

occurs.


Viewing all articles
Browse latest Browse all 88030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>