#1   Report Post  
candyyoung
 
Posts: n/a
Default 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   Report Post  
Dave Peterson
 
Posts: n/a
Default

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
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
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


All times are GMT +1. The time now is 11:36 AM.

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

About Us

"It's about Microsoft Excel"