macro for deleting blank rows and rows with text

cmefly

Well-known Member
Joined
May 13, 2003
Messages
683
hi,

i've got a column containing cells with just numbers, text, or blank.
I want to get rid of all the text and blank rows - and then transpose the column into the first row.....

any suggestions?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
select your column, press F5 to open the GoTo window

press 'special'

select the 'constants' radio button, and then uncheck everything except for 'text'. then press 'ok'. this will highlight all the cells in the column containing text. delete the rows.

then go back to the goto, special window, this time selecting the 'blanks' radio button to select and delete the blank cells.

now all that remains should be your number cells.

higlight the entire range of data in your column and copy it to the clipboard. then click in the place where you want to paste to, and right-click, then select 'paste special'. check the 'transpose' button, and press 'ok'.


hth
kevin
 
Upvote 0
hi keith,

it works perfectly except for the transpose part. I've got 449 rows to transpose into columns. excel only holds upto 255 columns...right?...this won't be possible..?
 
Upvote 0
excel has 256 columns max, so you're correct you won't be able to transpose your entire column into one row.

however, you could highlight the first 256 rows in your column and transpose these into the first row, then highlight the remaining and transpose these into the next row. it depends on what you need to do this for, and how your data needs to be laid out

hth

Kevin
 
Upvote 0
thanks keith......i think i'll just keep it the way it is and not transpose it at the moment
 
Upvote 0

Forum statistics

Threads
1,221,700
Messages
6,161,378
Members
451,700
Latest member
Eccymarge

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top