PC Review


Reply
Thread Tools Rate Thread

In a cell find words, copy and paste in another cell

 
 
sebastico
Guest
Posts: n/a
 
      27th May 2010
Hello

I apologize. In my previous question I did not include the code form Ron
that I'm testing.

Excel 2003
I have a sheet with six columns with 700 rows each with text. I have to red
all rows to find a word and copy and paste in the same cell of column b. This
is really heavy task and the risk of error is a problem. I 'm looking for a
code to do this task.

I have been trying the code from Ron de Bruin I found in this forum but when
I run the code this message is displayed:
Run-time error :1004:
Application defined or object defined error
I am learning VBA, I don't know hot to fix the error.

First I have been trying the search with in one column

I have a Sheet with 6 columns (F,G,H,I) with 700 rows.
I need a code to do this:
1. Read F:1 if find the word Apple, Then copy and paste the word in cell B:1
2. Go to F:2 if find the word Apple, Then copy and paste the word in cell B:2
3. Same until F700

If possible do the same application in Columns G, H, I

This is the code form ROn de Bruin

Sub Find_First()
Dim FindString As String
Dim rng As Range
FindString = "Apple"
If Trim(FindString) <> "" Then
With Sheets("Sheet1").Range("A:A")
Set rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
rng.Offset(0, 1).Copy rng.Parent.Range("D2")
Else
MsgBox "Nothing found"

End If
End With
End If
End Sub

Your help is welcome
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      27th May 2010
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"sebastico" <(E-Mail Removed)> wrote in message
news:097EF390-7AE5-4203-8842-(E-Mail Removed)...
> Hello
>
> I apologize. In my previous question I did not include the code form Ron
> that I'm testing.
>
> Excel 2003
> I have a sheet with six columns with 700 rows each with text. I have to
> red
> all rows to find a word and copy and paste in the same cell of column b.
> This
> is really heavy task and the risk of error is a problem. I 'm looking for
> a
> code to do this task.
>
> I have been trying the code from Ron de Bruin I found in this forum but
> when
> I run the code this message is displayed:
> Run-time error :1004:
> Application defined or object defined error
> I am learning VBA, I don't know hot to fix the error.
>
> First I have been trying the search with in one column
>
> I have a Sheet with 6 columns (F,G,H,I) with 700 rows.
> I need a code to do this:
> 1. Read F:1 if find the word Apple, Then copy and paste the word in cell
> B:1
> 2. Go to F:2 if find the word Apple, Then copy and paste the word in cell
> B:2
> 3. Same until F700
>
> If possible do the same application in Columns G, H, I
>
> This is the code form ROn de Bruin
>
> Sub Find_First()
> Dim FindString As String
> Dim rng As Range
> FindString = "Apple"
> If Trim(FindString) <> "" Then
> With Sheets("Sheet1").Range("A:A")
> Set rng = .Find(What:=FindString, _
> After:=.Cells(.Cells.Count), _
> LookIn:=xlValues, _
> LookAt:=xlWhole, _
> SearchOrder:=xlByRows, _
> SearchDirection:=xlNext, _
> MatchCase:=False)
> If Not rng Is Nothing Then
> rng.Offset(0, 1).Copy rng.Parent.Range("D2")
> Else
> MsgBox "Nothing found"
>
> End If
> End With
> End If
> End Sub
>
> Your help is welcome


 
Reply With Quote
 
New Member
Join Date: Apr 2011
Posts: 1
 
      13th Apr 2011
Help I need help...also...
How to find string like "Node:" in column A5-(all in column A) and copy the definition in column B5 ... to column C4
Search all the column in A and paste in C from column B


Help
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup cell, find Tab then copy/paste Cimjet Microsoft Excel Programming 6 27th Apr 2011 04:43 PM
Find cell - Copy & Paste Kell2604 Microsoft Excel Programming 11 17th Dec 2008 04:16 PM
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell suyash.nathani@gmail.com Microsoft Excel Worksheet Functions 2 7th Nov 2007 09:39 AM
Find first empty cell in column J. Copy, paste special, value from =?Utf-8?B?enp4eGNj?= Microsoft Excel Programming 12 12th Sep 2007 10:34 PM
copy/paste words in cell can't be read on screen =?Utf-8?B?TU8=?= Microsoft Excel Misc 2 28th Apr 2006 03:47 PM


Features
 

Advertising
 

Newsgroups
 


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