Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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? -- candyyoung ------------------------------------------------------------------------ candyyoung's Profile: http://www.excelforum.com/member.php...o&userid=26795 View this thread: http://www.excelforum.com/showthread...hreadid=400543 |
#2
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) |