Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default macro to delete zeros and formulas

Hi
I have in sheet 2 in column " E " numbers starting at row 3 down to row 1500 ,
some cells are empty (no numbers , no formulas ) where ever there is an empty
cell in column " E " I need to have in the same row the zero deleted in
column " G "
and the formula deleted in column " L" (both empty nothing in the cell )
If any one can help me , could you let me know how to activate the macro , I'm
no good with macros
Thanking you all in advance
--
bill gras
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default macro to delete zeros and formulas

Bill

I'd start this by saying you don't need a macro, you could in column E apply
autofilter (DataAutofilter) and filter on blanks, then highlight column G
and L in the filtered data and press the delete key.

You could replicate this in a macro or as below, iterate the range and do it
that way, for the number of cells you have it shouldn't take to long

Sub cleardata()
Dim myCell As Range
For Each myCell In Worksheets("Sheet2").Range("E3:E1500")
If myCell.Value = "" Then
myCell.Offset(0, 2).Clear
myCell.Offset(0, 7).Clear
End If
Next myCell
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"bill gras" wrote in message
...
Hi
I have in sheet 2 in column " E " numbers starting at row 3 down to row
1500 ,
some cells are empty (no numbers , no formulas ) where ever there is an
empty
cell in column " E " I need to have in the same row the zero deleted in
column " G "
and the formula deleted in column " L" (both empty nothing in the cell )
If any one can help me , could you let me know how to activate the macro ,
I'm
no good with macros
Thanking you all in advance
--
bill gras



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default macro to delete zeros and formulas

Hi Nick Hodge

You are a gentleman
Thank you very much !!!
regards bill gras
--
bill gras


"Nick Hodge" wrote:

Bill

I'd start this by saying you don't need a macro, you could in column E apply
autofilter (DataAutofilter) and filter on blanks, then highlight column G
and L in the filtered data and press the delete key.

You could replicate this in a macro or as below, iterate the range and do it
that way, for the number of cells you have it shouldn't take to long

Sub cleardata()
Dim myCell As Range
For Each myCell In Worksheets("Sheet2").Range("E3:E1500")
If myCell.Value = "" Then
myCell.Offset(0, 2).Clear
myCell.Offset(0, 7).Clear
End If
Next myCell
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"bill gras" wrote in message
...
Hi
I have in sheet 2 in column " E " numbers starting at row 3 down to row
1500 ,
some cells are empty (no numbers , no formulas ) where ever there is an
empty
cell in column " E " I need to have in the same row the zero deleted in
column " G "
and the formula deleted in column " L" (both empty nothing in the cell )
If any one can help me , could you let me know how to activate the macro ,
I'm
no good with macros
Thanking you all in advance
--
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 convert numbers and delete leading zeros Lori Excel Discussion (Misc queries) 18 January 12th 08 12:45 AM
How do you delete leading zeros from numbers? emronexcel Excel Discussion (Misc queries) 2 March 21st 07 11:00 PM
Macro to delete row if row blank but cells do have formulas in the Cathy Excel Programming 2 April 16th 06 01:07 AM
Delete leading zeros lunker55 Excel Discussion (Misc queries) 4 September 22nd 05 11:06 AM
Delete zeros in light yellow cells Claude Excel Programming 2 November 9th 03 01:51 PM


All times are GMT +1. The time now is 12:39 PM.

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

About Us

"It's about Microsoft Excel"