Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy and paste within macros

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...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default copy and paste within macros

On Mar 24, 3:20*pm, D'Artagnan
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
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
event macros vs copy/paste Dave Excel Worksheet Functions 2 November 17th 08 02:36 AM
Macros to copy and paste data Migyu Excel Discussion (Misc queries) 1 August 26th 08 01:25 PM
Problem with copy and paste together with macros Camper Joe Excel Worksheet Functions 2 August 24th 06 05:24 PM
Copy and Paste Macros dickives Excel Discussion (Misc queries) 0 January 20th 06 08:49 PM
Copy & Paste Drop Down Box with Macros Lana Excel Programming 0 November 11th 04 03:28 PM


All times are GMT +1. The time now is 04:38 PM.

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

About Us

"It's about Microsoft Excel"