I need to find a specific cell located in Column A:A on sheet 2 based on Sheet 1 D5, which is text based. I am not a code writer, but i find examples and work to modify them.
I need to select that Sheet2 cell in order to use it as a baseline to copy data from a "EditData" UserForm I have built. I have this built a 'NewEntry" Userform to add new data to a last row of a table based on using a "Find Last Row in Column A" macro.
So now i created a modified version of that "NewEntry" Userform to 'edit' existing data in a specific previous row of a table that corrosponds to the JobNumber listed in cell D5 on sheet1, so i need a starting point.
This was the original find last row code:
So i tried to create a new macro to find a specific cell:
But im getting a runtime error.
Ultimately, this will reside in the UserForm code, I was just trying to get the code to 'find and select' the target cell first.
Any assistance is appreciated.
Thanks
BV
I need to select that Sheet2 cell in order to use it as a baseline to copy data from a "EditData" UserForm I have built. I have this built a 'NewEntry" Userform to add new data to a last row of a table based on using a "Find Last Row in Column A" macro.
So now i created a modified version of that "NewEntry" Userform to 'edit' existing data in a specific previous row of a table that corrosponds to the JobNumber listed in cell D5 on sheet1, so i need a starting point.
This was the original find last row code:
VBA Code:
Private Sub CmdSubmit_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Active")
Sheets("Active").Select
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'copy the data to the database
ws.Cells(iRow, 1).Value = "Yes"
ws.Cells(iRow, 2).Value = Me.TextJobNumber.Value
ws.Cells(iRow, 3).Value = Me.TextProjectName.Value
ws.Cells(iRow, 4).Value = Me.TextAddress.Value
ws.Cells(iRow, 5).Value = Me.TextCSZ.Value
ws.Cells(iRow, 6).Value = Me.TextCustomer.Value
' Data continues for 20 cells...
Range("B10").Select
Sheets("Dashboard").Select
Range("I6").Select
End Sub
So i tried to create a new macro to find a specific cell:
Code:
Sub FindTarget()
Dim entry As String
Dim mycol As Integer
Dim myrow As Integer
entry = Sheet1.Range("E7").Value
mycol = Month(Now()) - 1
myrow = Application.WorksheetFunction.Match(Range("e7"), Sheet1.Range("A1:A100"), 0)
Sheet2.Range("a1").Select
End Sub
Ultimately, this will reside in the UserForm code, I was just trying to get the code to 'find and select' the target cell first.
Any assistance is appreciated.
Thanks
BV