+ Reply to Thread
Results 1 to 3 of 3

Thread: Macro Question

  1. #1
    ALoecher
    Guest

    Macro Question

    I am working with a large sheet and I need to create a macro that looks to
    see if there is a value in a cell Column G. If said cell is not null then I
    need to have it delete the information in the corresponding cell in Column F.
    I am a novice with excel and any help would be outstanding.

  2. #2
    Die_Another_Day
    Guest

    Re: Macro Question

    if Cells(YourRowNumberHere,"G").value <> "" then
    'if you want to clear contents do this
    Cells(YourRowNumberHere,"F").ClearContents
    'if you want to delete it and shift data up do this
    Cells(YourRowNumberHere,"F").Delete shift:=xlUp
    end if

    HTH

    Die_Another_Day

    ALoecher wrote:
    > I am working with a large sheet and I need to create a macro that looks to
    > see if there is a value in a cell Column G. If said cell is not null then I
    > need to have it delete the information in the corresponding cell in Column F.
    > I am a novice with excel and any help would be outstanding.



  3. #3
    Tom Ogilvy
    Guest

    RE: Macro Question

    do the cells contain constant values. If they don't are they empty (the
    cells you don't want to take action on).

    Dim rng as Range
    On Error Resume Next
    set rng = columns("G").SpecialCells(xlConstants)
    On Error goto 0
    if not rng is Nothing then
    set rng = Intersect(columns("F"),rng.EntireRow)
    rng.ClearContents
    End if

    --
    Regards,
    Tom Ogilvy





    "ALoecher" wrote:

    > I am working with a large sheet and I need to create a macro that looks to
    > see if there is a value in a cell Column G. If said cell is not null then I
    > need to have it delete the information in the corresponding cell in Column F.
    > I am a novice with excel and any help would be outstanding.


+ 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.2.0