+ Reply to Thread
Results 1 to 2 of 2

macro help

  1. #1
    Registered User
    Join Date
    08-30-2005
    Posts
    2

    macro help

    I am just learning Excel and I am trying to add a formula to some cells
    to do multiple functions. Here is what I am trying to do: IF G2=1 and
    H2=1, add "1" to E2 and delete G2 and H2. I have been told I need to create a macro for this. Any help on how to do it?

  2. #2
    Dave Peterson
    Guest

    Re: macro help

    I think your code (with no validation at all!) would look something like:

    Option Explicit
    Sub testme01()

    With Worksheets("sheet1")
    If .Range("g2").Value = 1 _
    And .Range("H2").Value = 1 Then
    .Range("e2").Value = .Range("e2").Value + 1
    .Range("g2:h2").ClearContents
    End If
    End With

    End Sub

    But when you run it is a question to me.

    candyyoung wrote:
    >
    > I am just learning Excel and I am trying to add a formula to some cells
    > to do multiple functions. Here is what I am trying to do: IF G2=1 and
    > H2=1, add "1" to E2 and delete G2 and H2. I have been told I need to
    > create a macro for this. Any help on how to do it?
    >
    > --
    > candyyoung
    > ------------------------------------------------------------------------
    > candyyoung's Profile: http://www.excelforum.com/member.php...o&userid=26795
    > View this thread: http://www.excelforum.com/showthread...hreadid=400543


    --

    Dave Peterson

+ 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