I'm struggling on figuring out why this is giving me an object required error.
It's erroring out on this line SNew.TextBox73 = ws.Cells(r, 2).Value
For some reason this code works though and it pretty much mimics it:
The code that is working is called from another userform.
Code:
Private Sub CommandButton2_Click()Dim ws As Worksheet
Dim wb As Workbook
Dim Answer As String
Dim MyNote As String
'Place your text here
MyNote = "Do any of your Providers have more than one specialty?"
Set wb = ThisWorkbook
Set ws = wb.Worksheets("Internal_Providers_&_Resources")
'''Find starting and ending range
srow = Application.WorksheetFunction.Match("S1", ws.Range("A:A"), 0) + 1
lrow = Application.WorksheetFunction.Match("En1", ws.Range("A:A"), 0) - 1
CA = Application.WorksheetFunction.CountA(ws.Range("E" & srow, "E" & lrow))
ws.Select
ws.Range("E" & srow, "E" & lrow).Select
Set rng = Selection.SpecialCells(xlCellTypeBlanks)
For Each cell In rng
r = cell.Row
SNew.TextBox73 = ws.Cells(r, 2).Value
SNew.Show
Next cell
End Sub
It's erroring out on this line SNew.TextBox73 = ws.Cells(r, 2).Value
For some reason this code works though and it pretty much mimics it:
Code:
For r = 2 To ws.Cells(Rows.Count, 20).End(xlUp).Row SpecialSAdd.TextBox73.Value = ws.Cells(r, 20).Value
SpecialSAdd.TextBox74.Value = Trim(Application.WorksheetFunction.IfError(Application.WorksheetFunction.Index(Sheets("Internal_Providers_&_Resources").Range("E:E"), Application.WorksheetFunction.Match(ws.Cells(r, 20).Value, Sheets("Internal_Providers_&_Resources").Range("B:B"), 0)), ""))
SpecialSAdd.Show
Next r