AveryHilditch
New Member
- Joined
- Oct 26, 2021
- Messages
- 4
- Office Version
- 2013
- Platform
- Windows
I am developing an app where I need to get the content of column 1 in a row selected by the user. When I run the app, a list box is populated with the contents of a table. I am currently working on an Update data function. Double clicking a row successfully populates the fields in a form. The first image shows some of the form and the second the list box.
If I double click a row, the data in the selected row is copied to the form. If I then click the Update button I have placed on the form, the contents of the form are copied back to the selected row in the list box and data table.
I am using the following code:
Private Sub UpdateBtn_Click()
Dim Selected_Row As Long
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Data")
Selected_Row = Application.WorksheetFunction.Match(Me.TextBox1.Value, sh.Range("A:A"), 0)
'... More code
End Sub
When I run the code, I get runtime error 1004 "Unable to get the Match property of the WorksheetFunction class"
I have used exactly the same function without any issues in other apps but not in this one. I am tearing my hair out trying to work out why it isn't working
Thank you
If I double click a row, the data in the selected row is copied to the form. If I then click the Update button I have placed on the form, the contents of the form are copied back to the selected row in the list box and data table.
I am using the following code:
Private Sub UpdateBtn_Click()
Dim Selected_Row As Long
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Data")
Selected_Row = Application.WorksheetFunction.Match(Me.TextBox1.Value, sh.Range("A:A"), 0)
'... More code
End Sub
When I run the code, I get runtime error 1004 "Unable to get the Match property of the WorksheetFunction class"
I have used exactly the same function without any issues in other apps but not in this one. I am tearing my hair out trying to work out why it isn't working
Thank you