still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 821
- Office Version
- 365
- Platform
- Windows
Hi.
I'm having a problem getting the following macro to work.
It's for a Userform.
The user enters a name in the Text box and and I will have a macro use it to do an advance search.
I will work on that after I get this to work. I don't for see any problems because I can copy and paste a lot of it from another book and modify it to suit (I may be back, but I'll use a different thread)
I keep getting an error at the line >>> If Range("checkresults").Value = "" Then <<
I used F5 and the range "checkresults" is correct. ( I checked the spelling and the 's' on the end...i've made that mistake before)
I changed the line to >>> If Range("BA3").Value = "" Then <<
and it works.
I tried to change the line to the actual cells and that didn't work. ("AP2:AU2")
the results will always be a text.
mike
I'm having a problem getting the following macro to work.
It's for a Userform.
The user enters a name in the Text box and and I will have a macro use it to do an advance search.
I will work on that after I get this to work. I don't for see any problems because I can copy and paste a lot of it from another book and modify it to suit (I may be back, but I'll use a different thread)
I keep getting an error at the line >>> If Range("checkresults").Value = "" Then <<
I used F5 and the range "checkresults" is correct. ( I checked the spelling and the 's' on the end...i've made that mistake before)
I changed the line to >>> If Range("BA3").Value = "" Then <<
and it works.
I tried to change the line to the actual cells and that didn't work. ("AP2:AU2")
the results will always be a text.
VBA Code:
Private Sub CommandButton1_Click()
With TextBox2 'name
ActiveSheet.Range("aw1").Value = .Text
End With
Me.Hide
Range("A1").Select
Unload Me
'If Range("checkresults").Value = "" Then
'If Range("BA3").Value = "" Then
MsgBox " NO RESULTS": Exit Sub
End If
End Sub