For Dave Hawley...
Posted by Nona Sloven on April 10, 2001 7:42 AM
Dave:
Again, thank you for your help. I wonder if you could possible make a little change in the code you sent me. This code is:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim WatchRange As Range, Rw As Integer
If Target.Cells.Count > 1 Then Exit Sub
If Not IsNumeric(Target) Then Exit Sub
Set WatchRange = Range("J25:J31")
If Not Intersect(Target, WatchRange) Is Nothing Then
Application.EnableEvents = False
On Error Resume Next
Rw = Target.Row
Select Case Range("F" & Rw)
Case "PART"
Target = Target * 1.12
Case "LABOUR"
Target = Target * 0.25
End Select
Application.EnableEvents = True
On Error GoTo 0
Set WatchRange = Nothing
End If
End Sub
It worked very well and solved me a problem. Could you please add some coding to this code so that it runs a macro named TOTAL when you select "TOTAL >>" in the cell with data validation? I tried but I did not succeed. Thank you.
Note: Below is the message that I posted:
I have a worksheet in Excel 97. I have seven cells set up each cell with data validation in column F forming a range from F25 to F31. Each of these seven cells only accept the following words: PART, LABOR, MISCELANEOUS and TOTAL. I have another column to enter amounts (numbers). This column is made up of cells J25 to J31. I want Excel to do the following: First after selecting any of the specific words listed above in the data validated cells, for example, in cell F25; if I then enter any number in J25, this number should be multiplied in this same cell by 1.12 only when it sees the word PART in F25 (the cell on the left in the same row). The same thing should happen entering any number in any of the cells J26 thru J31 and the same word (PART) is seen in in their adyacent F26 thru F31 cells, the number entered should be multiplied by 1.12. I also want Excel to do the same if the word selected is LABOR instead of PART. In this case, the multiplication should be by 1.24 instead of 1.12. Could anybody help? Your answer will be appreciated. Thanks.
Nona