I’m trying to write a code to do a sheet to sheet on going calculation . I have uploaded samples because I found out
In the past instead of me trying to explain it, it is easier this way. me trying to explain it gets everyone confused
Ok in sheet A (WS) I tried writing a code for each column from info coming from same sheet columns BR6 to DP20 to go to each Cell and column starting at BG7. One of the members here show me how to write a on- going calculation to go
To one cell , which is what I had asked for and it worked. But trying to write it for more than one cell, not only did my attempt to write code not work, it clear all the value figures in the entire section. So I exited out and clicked do not save.
So I need the experts’ advice again. Below was my attempt at writing a code. I put the Value +1 in it so would just add 1 to the the cell it was going to and not the box number that won the race. Example on sample A sheet the number (value) in BY7 is 5 and it would go to sample B sheet 2 AK3 as 1. All the numbers in sheet 1 from BY7 to DP20 are just box numbers, my goal is to see who many times each box comes in
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "BY6:DP20" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("BG7").Value = Range("BO70").Value + 1
Range("BG75").Value = Range("BO138").Value + 1
Range("DS7").Value = Range("EA70").Value + 1
Range("DS75").Value = Range("EA138").Value + 1
Range("EE7").Value = Range("EH70").Value + 1
Range("EE75").Value = Range("EH138").Value + 1
Range("EJ7").Value = Range("EM70").Value + 1
Range("EJ75").Value = Range("EM138").Value + 1
Range("EP7").Value = Range("ES70").Value + 1
Range("EP75").Value = Range("ES138").Value + 1
Range("EU7").Value = Range("EX70").Value + 1
Range("EU75").Value = Range("EX138").Value + 1
Range("FB7").Value = Range("FE70").Value + 1
Range("FB75").Value = Range("FE138").Value + 1
Range("FG7").Value = Range("FJ70").Value + 1
Range("FG75").Value = Range("FJ138").Value + 1
Range("FM7").Value = Range("FP70").Value + 1
Range("FM75").Value = Range("FP138").Value + 1
Range("FR7").Value = Range(FU"70").Value + 1
Range("FR75").Value = Range("FU138").Value + 1
Application.EnableEvents = True
End If
End If
End With
End Sub
So instead of messing up or losing all my info on sheet A (WS) I want to know how to write a proper code on sheet 2 (30DR) so it will send the correct value to each cell on sheet 2. Grade A will go to Grade A info section Grade B to Grade B ,etc. also is there a way to make this a 30 day results so after 30 days when it add day 31 it will go back to the first day so it becomes a continues 30 days results.
Bookmarks