ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to cut/paste/delete (https://www.excelbanter.com/excel-discussion-misc-queries/96269-macro-cut-paste-delete.html)

Betty Csehi

Macro to cut/paste/delete
 
I have a large database where I need a macro (or something) to find specific
information, cut it from its current row, and then paste it somewhere the
database. For example, the original database now looks like this:
A
1 #N/A
2 #N/A
3 GBA4326
4 #N/A
5 SLGG24

I want to find everything that is NOT #N/A, cut it and paste it below the
current database. So, with my example above the info below the original
database will now look like this:
A
1200 GBA4326
1201 SLGG24

and the original database will now look like this:
A
1 #N/A
2 #N/A
3 #N/A

I hope you get the gist of what I need. If anyone can help, I'd certainly
appreciate it as my database is over 1,000 rows. Thanks!




baxybaxy

Macro to cut/paste/delete
 

insert a column and add a formula =row() for every record - copy this
data and save as values

set up a filter on the database

select custom filter - is not equal to #N/A

cut the records out you don't want and paste below

remove the filter

sort the original records by original row number


--
baxybaxy
------------------------------------------------------------------------
baxybaxy's Profile: http://www.excelforum.com/member.php...o&userid=35824
View this thread: http://www.excelforum.com/showthread...hreadid=556008


baxybaxy

Macro to cut/paste/delete
 

insert a column and add a formula =row() for every record - copy this
data and save as values

set up a filter on the database

select custom filter - is not equal to #N/A

cut the records out you don't want and paste below

remove the filter

sort the original records by original row number


--
baxybaxy
------------------------------------------------------------------------
baxybaxy's Profile: http://www.excelforum.com/member.php...o&userid=35824
View this thread: http://www.excelforum.com/showthread...hreadid=556008


Dave Peterson

Macro to cut/paste/delete
 
Maybe you can just apply Data|Filter|autofilter to that column.

Then apply a custom filter of not equal to #n/a and copy the visible cells/rows
to where you want them.

Betty Csehi wrote:

I have a large database where I need a macro (or something) to find specific
information, cut it from its current row, and then paste it somewhere the
database. For example, the original database now looks like this:
A
1 #N/A
2 #N/A
3 GBA4326
4 #N/A
5 SLGG24

I want to find everything that is NOT #N/A, cut it and paste it below the
current database. So, with my example above the info below the original
database will now look like this:
A
1200 GBA4326
1201 SLGG24

and the original database will now look like this:
A
1 #N/A
2 #N/A
3 #N/A

I hope you get the gist of what I need. If anyone can help, I'd certainly
appreciate it as my database is over 1,000 rows. Thanks!


--

Dave Peterson


All times are GMT +1. The time now is 03:33 AM.

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