LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find Text from textBox then past what is found on sheet1

Assuming you don't have any errors:

code looks fine. so now you need to determine why it doesn't work. Turn on
the macro recorder and do a successful Edit=Find in the workbook with a
string that would be entered in the textbox. Turn off the macro recorder
and look at the code recorded. Make your find command have the same
arguments as that one except for the What:= argument.

Leave that as you have it.

Remove the On Error Resume next line.

Now run the code and see what happens.

--
Regards,
Tom Ogilvy


"Mark Cover" wrote in message
...
I have a textbox and I want to be able to search for data in a workbook

(that
is entered in the textBox) and when data is found paste the entire row

into
sheet 1 of the workbook. Any help on this would be greatly appreciated.
Thanks
-mark
Sample Code that does not work for me:
Private Sub cmdFind_Click()
Dim R As Range
On Error Resume Next
Dim Sheet As Worksheet
With Worksheets("Sheet2").Range("")
Set R = Range("activesheet").Find(What:=txtFind.Text, _
LookAt:=xlWhole)
If R Is Nothing Then
MsgBox "Bummer"
Else
R.Copy Destination:=Worksheets("Sheet1").Range("E5")
End If
End With
End Sub



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy and past cells found by SUMPRODUCT Tromal Excel Worksheet Functions 2 May 30th 10 02:03 PM
FIND function does not return ZERO when text is not found DOUG01A Excel Worksheet Functions 5 August 5th 08 05:56 PM
Find text in another workbook and paste if found match - VBA Pasmatos Excel Discussion (Misc queries) 1 November 10th 05 01:00 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM
Past directly into TextBox on UserForm DonB[_2_] Excel Programming 2 December 12th 03 02:01 AM


All times are GMT +1. The time now is 10:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"