Find from Textbox and Paste into Cell on sheet one
Hi Mark,
I think this should give you something to work with. I used the following:
Form called "frmFind"
Button called "cmdFind"
TextBox called "txtFind"
Hope it helps.
Regards,
James
Private Sub cmdFind_Click()
FindText
End Sub
Sub FindText()
Dim wkb As Workbook
Dim wks1 As Worksheet
Dim wks2 As Worksheet
Dim rng As Range
Dim rngSearch As Range
Set wkb = ThisWorkbook
Set wks1 = wkb.Worksheets("Sheet1")
Set wks2 = wkb.Worksheets("Sheet2")
Application.ScreenUpdating = False
wks2.Select
Set rngSearch = wks2.Range(Cells(10, 1), _
Cells(10, wks2.Range("IV10").End(xlToLeft).Column))
For Each rng In rngSearch
If UCase(rng.Value) = UCase(frmFind.txtFind.Value) Then
rng.EntireRow.Copy
wks1.Select
wks1.Range("A1").PasteSpecial (xlPasteAll)
wks1.Range("A1").Select
Application.CutCopyMode = False
Exit For
End If
Next rng
Application.ScreenUpdating = True
Set wks1 = Nothing
Set wks2 = Nothing
Set wkb = Nothing
MsgBox "DONE"
End Sub
"Mark Cover" wrote:
I need hellp finding data entered in a textbox, and I want to paste the
entire row in sheet1, example:
Form textbox = dog, Click Fiind
a10 = cat, b10 = dog, c10 = monkey
paste all cells in ss # 1.
Thanks for your help
-mark
|