PC Review


Reply
Thread Tools Rate Thread

Clear data and hide rows.

 
 
SANTANDER
Guest
Posts: n/a
 
      18th Mar 2008
I am looking for macro that will remove data from rows with zero value and
hide that rows.
For example, there is 3 columns, some rows contains data like this:

5962-9090801MVA abc CONVERTER I.C. 0.00
5962-9092701M3A 8Bit 35Msps Mil ADC 0.00
5962-9092701MXA 8Bit 35Msps Mil ADC 0.00
5962-9092702M3A 8Bit 35Msps Mil ADC 0.00

I just need search for rows like this, clear this data and hide this rows.
And the same thing for whole worksheet.

thank you.

 
Reply With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      18th Mar 2008
Sub Clear_Hide_Rows_With_Zero()
FindString = "0"
Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
While Not (B Is Nothing)
With B.EntireRow
.ClearContents
.Hidden = True
End With
Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
Wend
End Sub


Gord Dibben MS Excel MVP

On Tue, 18 Mar 2008 19:14:42 +0200, "SANTANDER" <(E-Mail Removed)>
wrote:

>I am looking for macro that will remove data from rows with zero value and
>hide that rows.
>For example, there is 3 columns, some rows contains data like this:
>
>5962-9090801MVA abc CONVERTER I.C. 0.00
>5962-9092701M3A 8Bit 35Msps Mil ADC 0.00
>5962-9092701MXA 8Bit 35Msps Mil ADC 0.00
>5962-9092702M3A 8Bit 35Msps Mil ADC 0.00
>
>I just need search for rows like this, clear this data and hide this rows.
>And the same thing for whole worksheet.
>
>thank you.


 
Reply With Quote
 
SANTANDER
Guest
Posts: n/a
 
      18th Mar 2008
Thank you, this works.
One note: after hiding multiple rows, the existing data now listed without
sequence, i.e. first rows is 1, then 104, 110, 176 and so on.
Does it possible to list rows with data in sequential order, one for
another, without this empty hidden rows?

Thanks,
Santander





"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:(E-Mail Removed)...
> Sub Clear_Hide_Rows_With_Zero()
> FindString = "0"
> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
> While Not (B Is Nothing)
> With B.EntireRow
> .ClearContents
> .Hidden = True
> End With
> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
> Wend
> End Sub
>
>
> Gord Dibben MS Excel MVP
>
> On Tue, 18 Mar 2008 19:14:42 +0200, "SANTANDER" <(E-Mail Removed)>
> wrote:
>
>>I am looking for macro that will remove data from rows with zero value
>>and
>>hide that rows.
>>For example, there is 3 columns, some rows contains data like this:
>>
>>5962-9090801MVA abc CONVERTER I.C. 0.00
>>5962-9092701M3A 8Bit 35Msps Mil ADC 0.00
>>5962-9092701MXA 8Bit 35Msps Mil ADC 0.00
>>5962-9092702M3A 8Bit 35Msps Mil ADC 0.00
>>
>>I just need search for rows like this, clear this data and hide this rows.
>>And the same thing for whole worksheet.
>>
>>thank you.

>


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      18th Mar 2008
Only by deleting rather than hiding the rows you cleared.

Change .Hidden = True to .Delete


Gord

On Tue, 18 Mar 2008 22:24:26 +0200, "SANTANDER" <(E-Mail Removed)>
wrote:

>Thank you, this works.
>One note: after hiding multiple rows, the existing data now listed without
>sequence, i.e. first rows is 1, then 104, 110, 176 and so on.
>Does it possible to list rows with data in sequential order, one for
>another, without this empty hidden rows?
>
>Thanks,
>Santander
>
>
>
>
>
>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>news:(E-Mail Removed)...
>> Sub Clear_Hide_Rows_With_Zero()
>> FindString = "0"
>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>> While Not (B Is Nothing)
>> With B.EntireRow
>> .ClearContents
>> .Hidden = True
>> End With
>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>> Wend
>> End Sub
>>
>>
>> Gord Dibben MS Excel MVP
>>
>> On Tue, 18 Mar 2008 19:14:42 +0200, "SANTANDER" <(E-Mail Removed)>
>> wrote:
>>
>>>I am looking for macro that will remove data from rows with zero value
>>>and
>>>hide that rows.
>>>For example, there is 3 columns, some rows contains data like this:
>>>
>>>5962-9090801MVA abc CONVERTER I.C. 0.00
>>>5962-9092701M3A 8Bit 35Msps Mil ADC 0.00
>>>5962-9092701MXA 8Bit 35Msps Mil ADC 0.00
>>>5962-9092702M3A 8Bit 35Msps Mil ADC 0.00
>>>
>>>I just need search for rows like this, clear this data and hide this rows.
>>>And the same thing for whole worksheet.
>>>
>>>thank you.

>>


 
Reply With Quote
 
SANTANDER
Guest
Posts: n/a
 
      19th Mar 2008
This not work:


Sub Clear_Hide_Rows_With_Zero()
FindString = "0"
Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
While Not (B Is Nothing)
With B.EntireRow
.ClearContents
.Delete = True
End With
Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
Wend
End Sub


thanks.
S.


"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:(E-Mail Removed)...
> Only by deleting rather than hiding the rows you cleared.
>
> Change .Hidden = True to .Delete
>
>
> Gord
>
> On Tue, 18 Mar 2008 22:24:26 +0200, "SANTANDER" <(E-Mail Removed)>
> wrote:
>
>>Thank you, this works.
>>One note: after hiding multiple rows, the existing data now listed without
>>sequence, i.e. first rows is 1, then 104, 110, 176 and so on.
>>Does it possible to list rows with data in sequential order, one for
>>another, without this empty hidden rows?
>>
>>Thanks,
>>Santander
>>
>>
>>
>>
>>
>>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>>news:(E-Mail Removed)...
>>> Sub Clear_Hide_Rows_With_Zero()
>>> FindString = "0"
>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>> While Not (B Is Nothing)
>>> With B.EntireRow
>>> .ClearContents
>>> .Hidden = True
>>> End With
>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>> Wend
>>> End Sub
>>>
>>>
>>> Gord Dibben MS Excel MVP
>>>
>>> On Tue, 18 Mar 2008 19:14:42 +0200, "SANTANDER"
>>> <(E-Mail Removed)>
>>> wrote:
>>>
>>>>I am looking for macro that will remove data from rows with zero value
>>>>and
>>>>hide that rows.
>>>>For example, there is 3 columns, some rows contains data like this:
>>>>
>>>>5962-9090801MVA abc CONVERTER I.C. 0.00
>>>>5962-9092701M3A 8Bit 35Msps Mil ADC 0.00
>>>>5962-9092701MXA 8Bit 35Msps Mil ADC 0.00
>>>>5962-9092702M3A 8Bit 35Msps Mil ADC 0.00
>>>>
>>>>I just need search for rows like this, clear this data and hide this
>>>>rows.
>>>>And the same thing for whole worksheet.
>>>>
>>>>thank you.
>>>

>


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      19th Mar 2008
You do not need the = True with .Delete

Were my instructions unclear or ambiguous?

Change .Hidden = True to .Delete


Gord

On Wed, 19 Mar 2008 20:41:08 +0200, "SANTANDER" <(E-Mail Removed)>
wrote:

>This not work:
>
>
>Sub Clear_Hide_Rows_With_Zero()
> FindString = "0"
> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
> While Not (B Is Nothing)
> With B.EntireRow
> .ClearContents
> .Delete = True
> End With
> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
> Wend
>End Sub
>
>
>thanks.
>S.
>
>
>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>news:(E-Mail Removed)...
>> Only by deleting rather than hiding the rows you cleared.
>>
>> Change .Hidden = True to .Delete
>>
>>
>> Gord
>>
>> On Tue, 18 Mar 2008 22:24:26 +0200, "SANTANDER" <(E-Mail Removed)>
>> wrote:
>>
>>>Thank you, this works.
>>>One note: after hiding multiple rows, the existing data now listed without
>>>sequence, i.e. first rows is 1, then 104, 110, 176 and so on.
>>>Does it possible to list rows with data in sequential order, one for
>>>another, without this empty hidden rows?
>>>
>>>Thanks,
>>>Santander
>>>
>>>
>>>
>>>
>>>
>>>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>>>news:(E-Mail Removed)...
>>>> Sub Clear_Hide_Rows_With_Zero()
>>>> FindString = "0"
>>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>>> While Not (B Is Nothing)
>>>> With B.EntireRow
>>>> .ClearContents
>>>> .Hidden = True
>>>> End With
>>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>>> Wend
>>>> End Sub
>>>>
>>>>
>>>> Gord Dibben MS Excel MVP
>>>>
>>>> On Tue, 18 Mar 2008 19:14:42 +0200, "SANTANDER"
>>>> <(E-Mail Removed)>
>>>> wrote:
>>>>
>>>>>I am looking for macro that will remove data from rows with zero value
>>>>>and
>>>>>hide that rows.
>>>>>For example, there is 3 columns, some rows contains data like this:
>>>>>
>>>>>5962-9090801MVA abc CONVERTER I.C. 0.00
>>>>>5962-9092701M3A 8Bit 35Msps Mil ADC 0.00
>>>>>5962-9092701MXA 8Bit 35Msps Mil ADC 0.00
>>>>>5962-9092702M3A 8Bit 35Msps Mil ADC 0.00
>>>>>
>>>>>I just need search for rows like this, clear this data and hide this
>>>>>rows.
>>>>>And the same thing for whole worksheet.
>>>>>
>>>>>thank you.
>>>>

>>


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      19th Mar 2008
BTW.................if you are deleting the rows you don't need to ClearContents

Sub Delete_Rows_With_Zero()
FindString = "0"
Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
While Not (B Is Nothing)
B.EntireRow.Delete
Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
Wend
End Sub


Gord


On Wed, 19 Mar 2008 13:47:21 -0700, Gord Dibben <gorddibbATshawDOTca> wrote:

>You do not need the = True with .Delete
>
>Were my instructions unclear or ambiguous?
>
>Change .Hidden = True to .Delete
>
>
>Gord
>
>On Wed, 19 Mar 2008 20:41:08 +0200, "SANTANDER" <(E-Mail Removed)>
>wrote:
>
>>This not work:
>>
>>
>>Sub Clear_Hide_Rows_With_Zero()
>> FindString = "0"
>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>> While Not (B Is Nothing)
>> With B.EntireRow
>> .ClearContents
>> .Delete = True
>> End With
>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>> Wend
>>End Sub
>>
>>
>>thanks.
>>S.
>>
>>
>>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>>news:(E-Mail Removed)...
>>> Only by deleting rather than hiding the rows you cleared.
>>>
>>> Change .Hidden = True to .Delete
>>>
>>>
>>> Gord
>>>
>>> On Tue, 18 Mar 2008 22:24:26 +0200, "SANTANDER" <(E-Mail Removed)>
>>> wrote:
>>>
>>>>Thank you, this works.
>>>>One note: after hiding multiple rows, the existing data now listed without
>>>>sequence, i.e. first rows is 1, then 104, 110, 176 and so on.
>>>>Does it possible to list rows with data in sequential order, one for
>>>>another, without this empty hidden rows?
>>>>
>>>>Thanks,
>>>>Santander
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>>>>news:(E-Mail Removed)...
>>>>> Sub Clear_Hide_Rows_With_Zero()
>>>>> FindString = "0"
>>>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>>>> While Not (B Is Nothing)
>>>>> With B.EntireRow
>>>>> .ClearContents
>>>>> .Hidden = True
>>>>> End With
>>>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>>>> Wend
>>>>> End Sub
>>>>>
>>>>>
>>>>> Gord Dibben MS Excel MVP
>>>>>
>>>>> On Tue, 18 Mar 2008 19:14:42 +0200, "SANTANDER"
>>>>> <(E-Mail Removed)>
>>>>> wrote:
>>>>>
>>>>>>I am looking for macro that will remove data from rows with zero value
>>>>>>and
>>>>>>hide that rows.
>>>>>>For example, there is 3 columns, some rows contains data like this:
>>>>>>
>>>>>>5962-9090801MVA abc CONVERTER I.C. 0.00
>>>>>>5962-9092701M3A 8Bit 35Msps Mil ADC 0.00
>>>>>>5962-9092701MXA 8Bit 35Msps Mil ADC 0.00
>>>>>>5962-9092702M3A 8Bit 35Msps Mil ADC 0.00
>>>>>>
>>>>>>I just need search for rows like this, clear this data and hide this
>>>>>>rows.
>>>>>>And the same thing for whole worksheet.
>>>>>>
>>>>>>thank you.
>>>>>
>>>


 
Reply With Quote
 
SANTANDER
Guest
Posts: n/a
 
      20th Mar 2008
That's fine, thank you.

Santander



"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news(E-Mail Removed)...
> BTW.................if you are deleting the rows you don't need to
> ClearContents
>
> Sub Delete_Rows_With_Zero()
> FindString = "0"
> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
> While Not (B Is Nothing)
> B.EntireRow.Delete
> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
> Wend
> End Sub
>
>
> Gord
>
>
> On Wed, 19 Mar 2008 13:47:21 -0700, Gord Dibben <gorddibbATshawDOTca>
> wrote:
>
>>You do not need the = True with .Delete
>>
>>Were my instructions unclear or ambiguous?
>>
>>Change .Hidden = True to .Delete
>>
>>
>>Gord
>>
>>On Wed, 19 Mar 2008 20:41:08 +0200, "SANTANDER" <(E-Mail Removed)>
>>wrote:
>>
>>>This not work:
>>>
>>>
>>>Sub Clear_Hide_Rows_With_Zero()
>>> FindString = "0"
>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>> While Not (B Is Nothing)
>>> With B.EntireRow
>>> .ClearContents
>>> .Delete = True
>>> End With
>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>> Wend
>>>End Sub
>>>
>>>
>>>thanks.
>>>S.
>>>
>>>
>>>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>>>news:(E-Mail Removed)...
>>>> Only by deleting rather than hiding the rows you cleared.
>>>>
>>>> Change .Hidden = True to .Delete
>>>>
>>>>
>>>> Gord
>>>>
>>>> On Tue, 18 Mar 2008 22:24:26 +0200, "SANTANDER"
>>>> <(E-Mail Removed)>
>>>> wrote:
>>>>
>>>>>Thank you, this works.
>>>>>One note: after hiding multiple rows, the existing data now listed
>>>>>without
>>>>>sequence, i.e. first rows is 1, then 104, 110, 176 and so on.
>>>>>Does it possible to list rows with data in sequential order, one for
>>>>>another, without this empty hidden rows?
>>>>>
>>>>>Thanks,
>>>>>Santander
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>>>>>news:(E-Mail Removed)...
>>>>>> Sub Clear_Hide_Rows_With_Zero()
>>>>>> FindString = "0"
>>>>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>>>>> While Not (B Is Nothing)
>>>>>> With B.EntireRow
>>>>>> .ClearContents
>>>>>> .Hidden = True
>>>>>> End With
>>>>>> Set B = Range("C:C").Find(What:=FindString, LookAt:=xlWhole)
>>>>>> Wend
>>>>>> End Sub
>>>>>>
>>>>>>
>>>>>> Gord Dibben MS Excel MVP
>>>>>>
>>>>>> On Tue, 18 Mar 2008 19:14:42 +0200, "SANTANDER"
>>>>>> <(E-Mail Removed)>
>>>>>> wrote:
>>>>>>
>>>>>>>I am looking for macro that will remove data from rows with zero
>>>>>>>value
>>>>>>>and
>>>>>>>hide that rows.
>>>>>>>For example, there is 3 columns, some rows contains data like this:
>>>>>>>
>>>>>>>5962-9090801MVA abc CONVERTER I.C. 0.00
>>>>>>>5962-9092701M3A 8Bit 35Msps Mil ADC 0.00
>>>>>>>5962-9092701MXA 8Bit 35Msps Mil ADC 0.00
>>>>>>>5962-9092702M3A 8Bit 35Msps Mil ADC 0.00
>>>>>>>
>>>>>>>I just need search for rows like this, clear this data and hide this
>>>>>>>rows.
>>>>>>>And the same thing for whole worksheet.
>>>>>>>
>>>>>>>thank you.
>>>>>>
>>>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to clear rows before copying data steve1040 Microsoft Excel Programming 1 17th Apr 2009 04:58 AM
Clear entire rows below last row of data in col A except in 1st 3 sheets Max Microsoft Excel Programming 6 7th Jan 2008 10:33 AM
Clear rows with no data? =?Utf-8?B?S2FpIEN1bm5pbmdoYW0=?= Microsoft Excel Programming 4 2nd Jul 2007 10:44 PM
Clear unchanged rows in a data table Ryan Microsoft ADO .NET 8 28th Jan 2007 11:08 AM
Help to clear data & delete rows =?Utf-8?B?RWRkeSBTdGFu?= Microsoft Excel Programming 1 11th Mar 2006 10:29 AM


Features
 

Advertising
 

Newsgroups
 


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