I must be stupid

i8ig

Board Regular
Joined
Jul 17, 2007
Messages
122
Can someone suggest how to make this work?


Code:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/28/2007 by i8ig
'

If Target.Column = 1 Then
   If Target.Value = "Med" Then
      Rows(Target.Row).Interior.ColorIndex = 4
      Range("H3").Select
      ActiveCell.FormulaR1C1 = "=IF(RC[3]="""","""",RC[3]-3)"
   Else
       If Target.Value = "Tasc" Then
          Rows("4:4").Interior.ColorIndex = 44
          Range("H4").Select
          ActiveCell.FormulaR1C1 = "=IF(RC[1]="""","""",RC[1]-2)"
       Else
           If Target.Range = "NBAR" Then
              Range("J5").Select
              ActiveCell.FormulaR1C1 = "=IF(RC[1]="""","""",RC[1]-5)"
              Range("I5").Select
              ActiveCell.FormulaR1C1 = "=IF(RC[1]="""","""",RC[1]-2)"
              Range("H5").Select
              ActiveCell.FormulaR1C1 = "=IF(RC[1]="""","""",RC[1]-2)"
           End If
       End If
   End If
End If
End Sub

I continue to receive an error '424' object required and I cant find it

EDIT: added code tags - Smitty
 
Take a look at this.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Target is being passed to the worksheet's change event and refers to the range that has been changed.

There's nothing like that in your code.

And you've still not really indicated what you want the code to do and when it should be triggered.:)

Roy's code will be triggered when a value is entered in column 1.

Is that what you want?
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top