Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default delete certain rows only

below is the spreadsheet I have with a lot of data. I need to keep only the
data which has in cell column (status) c: the value 1. If the value is 0 then
the rows above the 0 are not required. As there are over 15,000 rows and no
set amount of rows for each block (column A0 does anyone have a function or
module solution for this query. Thanks again all.

block house status
100x Perth Crescent 100 Perth Crescent A
102 Perth Crescent S
0


1015x Dumbarton Road 1019 Dumbarton Road A
1015 Dumbarton Road S
1017 Dumbarton Road S
1

101x Craigs Avenue 101 Craigs Avenue A
107 Craigs Avenue A
103 Craigs Avenue S
105 Craigs Avenue S
1



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default delete certain rows only


Will there always be a blank row above the block of data as you have
shown?

tom mcd;505043 Wrote:
below is the spreadsheet I have with a lot of data. I need to keep only
the
data which has in cell column (status) c: the value 1. If the value is
0 then
the rows above the 0 are not required. As there are over 15,000 rows
and no
set amount of rows for each block (column A0 does anyone have a
function or
module solution for this query. Thanks again all.

block house status
100x Perth Crescent 100 Perth Crescent A
102 Perth Crescent S
0


1015x Dumbarton Road 1019 Dumbarton Road A
1015 Dumbarton Road S
1017 Dumbarton Road S
1

101x Craigs Avenue 101 Craigs Avenue A
107 Craigs Avenue A
103 Craigs Avenue S
105 Craigs Avenue S
1



--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=138900

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default delete certain rows only

Yes Simon there will always be a blank row above each block of data

"Simon Lloyd" wrote:


Will there always be a blank row above the block of data as you have
shown?

tom mcd;505043 Wrote:
below is the spreadsheet I have with a lot of data. I need to keep only
the
data which has in cell column (status) c: the value 1. If the value is
0 then
the rows above the 0 are not required. As there are over 15,000 rows
and no
set amount of rows for each block (column A0 does anyone have a
function or
module solution for this query. Thanks again all.

block house status
100x Perth Crescent 100 Perth Crescent A
102 Perth Crescent S
0


1015x Dumbarton Road 1019 Dumbarton Road A
1015 Dumbarton Road S
1017 Dumbarton Road S
1

101x Craigs Avenue 101 Craigs Avenue A
107 Craigs Avenue A
103 Craigs Avenue S
105 Craigs Avenue S
1



--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=138900


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default delete certain rows only

Brilliant Don, thanks a lot.

"Don Guillett" wrote:

Sub deleteblocks()
'insert a row at row2 FIRST
mc = 1 'Column A
For i = Cells(Rows.Count, mc).End(xlUp) _
.Row To 2 Step -1
If Len(Application.Trim(Cells(i, mc))) 0 _
And Cells(i, mc) = 0 Then
Range(Cells(i, mc), Cells(i, mc).End(xlUp)) _
.EntireRow.Delete
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"tom mcd" <tom
wrote in message
...
below is the spreadsheet I have with a lot of data. I need to keep only
the
data which has in cell column (status) c: the value 1. If the value is 0
then
the rows above the 0 are not required. As there are over 15,000 rows and
no
set amount of rows for each block (column A0 does anyone have a function
or
module solution for this query. Thanks again all.

block house status
100x Perth Crescent 100 Perth Crescent A
102 Perth Crescent S
0


1015x Dumbarton Road 1019 Dumbarton Road A
1015 Dumbarton Road S
1017 Dumbarton Road S
1

101x Craigs Avenue 101 Craigs Avenue A
107 Craigs Avenue A
103 Craigs Avenue S
105 Craigs Avenue S
1





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete & Merge Columns,Delete Rows with filter, etc traderindia Excel Programming 1 July 16th 09 08:17 PM
Delete Rows if any cell in Column H is blank but do not Delete Fir manfareed Excel Programming 4 September 28th 07 05:20 PM
Copy pasting Rows, but need to Delete any Shapes/Pictures that are within copied rows Corey Excel Programming 2 August 1st 07 02:02 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 05:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"