View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
jkramos2005 jkramos2005 is offline
external usenet poster
 
Posts: 8
Default How to write a "change macro"

Thank you so much for the help everyone!!!!!

"jkramos2005" wrote:

Help!!! I am trying to write something that is referred to as a "change
macro" statement. In my excel worksheet based on what I enter into one cell
(either "0" or "1"), I would like for excel to take formulas that I have
hidden way to the right side of the spreadsheet and copy the appropriate
formula whether it be "0" or "1".

Below is the working statements that I have written:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$I$37"=1 Then "$P$37"="$DM$37" Then "$AY$37"="$DM$37"
If Target.Address = "$I$37"=0 Then "$O$37"="$DL$37" Then "$AX$37"="$DL$37"
Then "$P$37"="$DN$37" Then "$AY$37"="$DN$37"


End Sub

I then get a Microsoft Visual Basic Compile Error: Syntax Error

Any guidance would be most apppreicated.

Thanks!