Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default empty a entire row

I have formulas in cells in column "C" and when a formula returns a "0" (zero)
I need to empty (not delete) that entire row or rows what ever the case may
be,
from column "C,D,E,F" ect. on wards as far as it will go.
I need to have the rows in columns "A,B" untouched) there are 8000 rows
Can some one help me please
Thanks
regards bill
--
bill gras
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default empty a entire row

Here is some code for you. Right click on the appropriate sheet tab and
select view code. Paste this in the code window and you should be good to
go...

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
With Target
If .Column = 3 And .Value = 0 Then
Application.EnableEvents = False
Range(.Offset(0, 1), .Offset(0, Columns.Count - 3)).ClearContents
End If
End With
ErrorHandler:
Application.EnableEvents = True
End Sub

--
HTH...

Jim Thomlinson


"bill gras" wrote:

I have formulas in cells in column "C" and when a formula returns a "0" (zero)
I need to empty (not delete) that entire row or rows what ever the case may
be,
from column "C,D,E,F" ect. on wards as far as it will go.
I need to have the rows in columns "A,B" untouched) there are 8000 rows
Can some one help me please
Thanks
regards bill
--
bill gras

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default empty a entire row

Hi Jim
Thank you for your reply and the explanation how to apply the code
Thanks again
regards bill
--
bill gras


"Jim Thomlinson" wrote:

Here is some code for you. Right click on the appropriate sheet tab and
select view code. Paste this in the code window and you should be good to
go...

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
With Target
If .Column = 3 And .Value = 0 Then
Application.EnableEvents = False
Range(.Offset(0, 1), .Offset(0, Columns.Count - 3)).ClearContents
End If
End With
ErrorHandler:
Application.EnableEvents = True
End Sub

--
HTH...

Jim Thomlinson


"bill gras" wrote:

I have formulas in cells in column "C" and when a formula returns a "0" (zero)
I need to empty (not delete) that entire row or rows what ever the case may
be,
from column "C,D,E,F" ect. on wards as far as it will go.
I need to have the rows in columns "A,B" untouched) there are 8000 rows
Can some one help me please
Thanks
regards bill
--
bill gras

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default empty a entire row

Hi Jim
I have enterd the macro as you adviced , but nothing happend
when I ran the macro
regards bill
--
bill gras


"Jim Thomlinson" wrote:

Here is some code for you. Right click on the appropriate sheet tab and
select view code. Paste this in the code window and you should be good to
go...

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
With Target
If .Column = 3 And .Value = 0 Then
Application.EnableEvents = False
Range(.Offset(0, 1), .Offset(0, Columns.Count - 3)).ClearContents
End If
End With
ErrorHandler:
Application.EnableEvents = True
End Sub

--
HTH...

Jim Thomlinson


"bill gras" wrote:

I have formulas in cells in column "C" and when a formula returns a "0" (zero)
I need to empty (not delete) that entire row or rows what ever the case may
be,
from column "C,D,E,F" ect. on wards as far as it will go.
I need to have the rows in columns "A,B" untouched) there are 8000 rows
Can some one help me please
Thanks
regards bill
--
bill gras

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
How to SUM entire column, but only when adjacent cell is not empty SteveDJ Excel Worksheet Functions 3 May 7th 10 09:16 PM
Is there a test to see if an entire row or column is empty? Henry Stock Excel Programming 3 February 25th 05 05:50 PM
Change Empty Cells Font for the Entire Workbook Paul Black Excel Programming 21 September 15th 04 09:49 AM
Delete entire row if A1,2,3... is empty cimento cola Excel Programming 4 February 21st 04 04:31 PM
Is entire row empty? soylent green Excel Programming 10 November 13th 03 06:44 PM


All times are GMT +1. The time now is 12:57 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"