#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Easy Macro


Hey i have Created this Easy Macro-

Sub testmacro()
'
' testmacro Macro
' A Cell adds info to other cells
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B1").Select
ActiveCell.FormulaR1C1 = "YES"
Range("C1").Select
ActiveCell.FormulaR1C1 = "NO"
Range("D1").Select
ActiveCell.FormulaR1C1 = "NO"
Range("E1").Select
ActiveCell.FormulaR1C1 = "YES"
Range("A1").Select
End Sub


Now this Macro is a Button which i dont want. I want it so when i ente
"1" into the "A" cell it adds the YES-NO-NO-YES into the other cell
shown above. Any help people? Remember i dont want a button just cod
that works when enter "1" in cell A. Thank

--
joelbeveridg
-----------------------------------------------------------------------
joelbeveridge's Profile: http://www.excelforum.com/member.php...fo&userid=3704
View this thread: http://www.excelforum.com/showthread.php?threadid=56772

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Easy Macro

Joel,
Try this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("a1")) Is Nothing Then
If Target.Value = 1 Then
Range("B1").Value = "YES"
Range("C1").Value = "NO"
Range("D1").Value = "NO"
Range("E1").Value = "YES"
Else
Range("B1:E1").ClearContents
End If
End If
End Sub

Change what you want to happen is the value < 1.

NickHK

"joelbeveridge"
wrote in message
news:joelbeveridge.2bxxx6_1154569510.1202@excelfor um-nospam.com...

Hey i have Created this Easy Macro-

Sub testmacro()
'
' testmacro Macro
' A Cell adds info to other cells
'
Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Range("B1").Select
ActiveCell.FormulaR1C1 = "YES"
Range("C1").Select
ActiveCell.FormulaR1C1 = "NO"
Range("D1").Select
ActiveCell.FormulaR1C1 = "NO"
Range("E1").Select
ActiveCell.FormulaR1C1 = "YES"
Range("A1").Select
End Sub


Now this Macro is a Button which i dont want. I want it so when i enter
"1" into the "A" cell it adds the YES-NO-NO-YES into the other cells
shown above. Any help people? Remember i dont want a button just code
that works when enter "1" in cell A. Thanks


--
joelbeveridge
------------------------------------------------------------------------
joelbeveridge's Profile:

http://www.excelforum.com/member.php...o&userid=37045
View this thread: http://www.excelforum.com/showthread...hreadid=567724



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 Help, Real Easy comotoman Excel Discussion (Misc queries) 4 January 30th 06 03:43 PM
easy macro? Ctech[_77_] Excel Programming 6 January 20th 06 01:43 AM
Tiering Macro, Should be easy? [email protected] Excel Programming 3 September 8th 05 11:48 PM
Easy Excel Macro? sva3 Excel Programming 1 August 19th 05 03:25 PM
VBA macro easy problem! Andrew Slentz Excel Programming 2 May 7th 04 06:39 AM


All times are GMT +1. The time now is 09:59 PM.

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"