ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA (https://www.excelbanter.com/excel-programming/368908-excel-vba.html)

gregory

Excel VBA
 
I have a set of data that contains:
- 10 rows that start with 001
- 10 rows that start with 002
- 10 rows that start with 003.

How should the macro be written to find only the rows that start with 002
and copy those to another spreadsheet?

Tom Ogilvy

Excel VBA
 
for each cell in Range("A1:A30")
if cell.Text = "002" then

Next

also, if you are copying or something:
Perhaps something on this page

http://www.rondebruin.nl/copy5.htm

at Ron de Bruin's site

--
Regards,
Tom Ogilvy



--
Regards,
Tom Ogilvy


"gregory" wrote:

I have a set of data that contains:
- 10 rows that start with 001
- 10 rows that start with 002
- 10 rows that start with 003.

How should the macro be written to find only the rows that start with 002
and copy those to another spreadsheet?



All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com