![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Brian
Posts: 37
|
I need a macro that will delete balnk rows for a selected range that varies each time I receive the document.
Help! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: May 2002
Location: Ipswich, Suffolk, England
Posts: 135
|
Will for example column A always be blank, of will there sometimes be nothing in A but something in B ect.. If this is the case set your Macro recorder to On and record yourself using the filter comand and select columns A as non blanks copy then paste to desired worksheet
|
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Location: Brian
Posts: 37
|
How do you get non-blanks to filter.
I cannot get that option on my filter command? thanks, |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: May 2002
Location: Ipswich, Suffolk, England
Posts: 135
|
If you select the row with your headings and choose, autofilter, you should then see the filter tabs. If you then click on the one with blank cells e.g. column A, scroll all the way to the bottom of the selectable variables you should be presented with the options to show Blanks & Non Blanks
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: May 2002
Location: Ipswich, Suffolk, England
Posts: 135
|
try using the following code in a macro
sheets("put your sheet name here").select Rows("1:1").Select 'this should be the heading of you sheet Selection.AutoFilter Selection.AutoFilter Field:=1,'this will be colums A as discuss before Criteria1:="=" Rows("6:101").Select Selection.Delete Shift:=xlUp Selection.AutoFilter Field:=1 |
|
|
|
|
|
#6 |
|
New Member
Join Date: May 2002
Location: Brian
Posts: 37
|
thanks
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|