PC Review


Reply
Thread Tools Rate Thread

copy and paste within macros

 
 
D'Artagnan
Guest
Posts: n/a
 
      24th Mar 2008
While recording a macro:
1) a *.txt file is opened
2) after opening the file a "FIND where ANY =" is used then I click on FIND
ALL
3) it get a long list of cells.... then by holding SHIFT and clicking the
last cell it highlights those lines where the "ANY =" string appears.
4) The cursor is placed on any of the highlighted cells and PASTED on
another column of the same worksheet, a column gets copied with only those
cells with an "ANY =".
The worksheet is saved...as well as the Macro.
However when the macro is run it only displays one line........the first
line with "ANY ="
Is it possible to do a FIND and then COPY the range of cells from the FIND
Pop Up Window?
Thanks a lot...
 
Reply With Quote
 
 
 
 
Shaka215@gmail.com
Guest
Posts: n/a
 
      24th Mar 2008
On Mar 24, 3:20*pm, D'Artagnan <D'Artag...@discussions.microsoft.com>
wrote:
> While recording a macro:
> 1) a *.txt file is opened
> 2) after opening the file a "FIND where ANY =" is used then I click on FIND
> ALL
> 3) it get a long list of cells.... then by holding SHIFT and clicking the
> last cell it *highlights those lines where the "ANY =" string appears.
> 4) The cursor is placed on any of the highlighted cells and PASTED on
> another column of the same worksheet, a column gets copied with only those
> cells with an "ANY =".
> The worksheet is saved...as well as the Macro.
> However when the macro is run it only displays one line........the first
> line with "ANY ="
> Is it possible to do a FIND and then COPY the range of cells from the FIND
> Pop Up Window?
> Thanks a lot...


Sub RunIt()

Sheets("Sheet2").Select
Range("A2").Select
Sheets("Sheet1").Select
Range("A2").Select
' or where ever you have the "ANY =" value.

Do

If ActiveCell.Value = "ANY =" Then
ActiveCell.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
ActiveCell.Offset(1,0).Select
Sheets("SHEET1").Select
ActiveCell.Offset(1,0).Select
End If

If ActiveCell.Value <> "ANY =" Then
ActiveCell.Offset(1,0).Select
End If

Loop Until ActiveCell.Offset(5, 0).Value = ""
 
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
event macros vs copy/paste Dave Microsoft Excel Worksheet Functions 2 17th Nov 2008 02:36 AM
Macros to copy and paste data Migyu Microsoft Excel Misc 1 26th Aug 2008 01:25 PM
How do I enable my macros because I can't copy and paste Obi Microsoft Word Document Management 1 19th Jul 2008 12:57 PM
Copy and Paste Macros dickives Microsoft Excel Misc 0 20th Jan 2006 08:49 PM
copy and paste macros Drew Microsoft Excel Misc 2 2nd Jun 2004 07:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:10 AM.