+ Reply to Thread
Results 1 to 3 of 3

macro to delete zeros and formulas

Hybrid View

  1. #1
    bill gras
    Guest

    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. #2
    Nick Hodge
    Guest

    Re: 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 (Data>Autofilter) 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
    nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS


    "bill gras" <billgras@discussions.microsoft.com> wrote in message
    news:3870F48B-BE49-45AA-A860-95F2F69E0A6B@microsoft.com...
    > 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. #3
    bill gras
    Guest

    Re: 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 (Data>Autofilter) 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
    > nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS
    >
    >
    > "bill gras" <billgras@discussions.microsoft.com> wrote in message
    > news:3870F48B-BE49-45AA-A860-95F2F69E0A6B@microsoft.com...
    > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1