LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default find and paste

This is the code im using. The part from Founcell.Copy does not seem to be
working.
Can anyone help?

Private Sub CommandButton1_Click()
Dim wks As Worksheet
Dim FoundCell As Range

Set wks = Worksheets("Sheet1")
If Me.TextBox1.Value = "" Then
Beep
MsgBox "Please enter HRI"
Exit Sub
End If

With wks
With .Range("A:A")

Set FoundCell = .Cells.Find(what:=Me.TextBox1.Value, _
after:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
Lookat:=xlWhole, _
searchorder:=xlByRows, _
searchdirection:=xlNext, _
MatchCase:=False)

FoundCell.Copy

Sheets("Sheet2").Select

Range("A2").Select

ActiveSheet.Paste

UserForm1.Hide

Sheets("Sheet2").Select
End With
End With

If FoundCell Is Nothing Then
UserForm1.Hide
UserForm2.Show


Else
MsgBox "Found HRI: " & FoundCell.Value
End If


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
Find Cut and paste kingie Excel Discussion (Misc queries) 4 November 8th 09 08:33 PM
Find and Paste Ronbo Excel Programming 5 April 1st 06 03:20 AM
find and paste ceemo[_2_] Excel Programming 5 July 25th 05 06:10 PM
I need to find a macro to find data cut and paste to another colu. Rex Excel Programming 6 December 7th 04 09:22 AM
Paste value of Find John Keturi Excel Programming 5 October 16th 04 11:44 PM


All times are GMT +1. The time now is 06:36 AM.

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"