Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
event macros vs copy/paste | Excel Worksheet Functions | |||
Macros to copy and paste data | Excel Discussion (Misc queries) | |||
Problem with copy and paste together with macros | Excel Worksheet Functions | |||
Copy and Paste Macros | Excel Discussion (Misc queries) | |||
Copy & Paste Drop Down Box with Macros | Excel Programming |