Hi,
Require assistance to modify code below
As data is entered in column J6 : J19 cells , each cell in Column K to divide J6 :J19 by " J20"
Example : J20 has data= 120
user inputs in J6 as 10
Column K6 result = J6/J20
user inputs in J7 as 20
Column K7 result = J7/J20
and so on...
Much Appreciated...
Require assistance to modify code below
As data is entered in column J6 : J19 cells , each cell in Column K to divide J6 :J19 by " J20"
Example : J20 has data= 120
user inputs in J6 as 10
Column K6 result = J6/J20
user inputs in J7 as 20
Column K7 result = J7/J20
and so on...
Much Appreciated...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ay = Target.Row
ax = Target.Column
If ax = 10 Then
Application.ScreenUpdating = False
Application.EnableEvents = False
With Sheets("Output")
Select Case ay
Case 5
x = WorksheetFunction.Match(Sheets("Output").Range("$J$5"), Sheets("Dropdown").Range("$G$1:$G$13"), 0) - 2
.Range(.Cells(6, 12 + x * 3), .Cells(20, 13 + x * 3)).Copy Destination:=.Range("$J$6")
Case 6 To 20
yy = WorksheetFunction.Sum(.Range("$J$6:$J$19"))
.Range("$K$4:$K$19").NumberFormat = "0%"
For y = 6 To 20
.Cells(y, 11) = .Cells(y, 10) / yy
Next y
x = WorksheetFunction.Match(Sheets("Output").Range("$J$5"), Sheets("Dropdown").Range("$G$1:$G$13"), 0) - 2
.Cells(5, 12 + x * 3) = Sheets("Dropdown").Cells(2 + x, 5)
.Range("$J$6:$K$19").Copy Destination:=.Cells(6, 12 + x * 3)
End Select
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
Call Macro1
End Sub
Attachments
Last edited: