Transfer data to cell with matching row and header

djossh

Board Regular
Joined
Jul 27, 2009
Messages
243
Hi, I have a userform with 3 textbox. textbox1 is for Row (Criteria) textbox2 is for Header (Criteria) and textbox3 for Data entry.
i would like to transfer the Data in textbox3 to Sheet1 of my worksheets that match the Row and Header from my textbox1 & texbox2
thanks for the help. please see sample pictures. thanks again
 

Attachments

  • SCSHOT.jpg
    SCSHOT.jpg
    103.2 KB · Views: 11

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hello,

This should work for you:
VBA Code:
Private Sub CommandButton1_Click()
  Dim a As Object
  Set a = Application
  With Worksheets("Sheet1")
  If Not IsError(a.Match(TextBox1.Text, .Range("A:A"), 0)) And Not IsError(a.Match(TextBox2.Text, .Range("1:1"), 0)) Then
    .Cells(a.Match(TextBox1.Text, .Range("A:A"), 0), a.Match(TextBox2.Text, .Range("1:1"), 0)).Value = TextBox3.Text
  End If
  End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,206
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top