In the code below, recording TO respective sheets works well...
recording FROM respective sheets changes the value in B3 thus execute the recording TO respective sheets again... the former is essential, how to stop the latter ?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myWS As String ' gets the form/year that is similar to sheet to copy/record
myWS = Sheet1.Range("B1").Value ' say F1 (sheet name)
Dim myL As String ' gets the lesson num in sow
myL = Sheet1.Range("B2").Value ' say 1
If Not Intersect(Target, Range("B3:B11")) Is Nothing Then ' recording to respectives sheets
Worksheets("Sheet1").Range("B3").Copy Worksheets(myWS).Range("A" & myL & "") 'copy to sheet F1 cell A1
End If
If Not Intersect(Target, Range("B1:B2")) Is Nothing Then ' recording from respective sheets
Worksheets(myWS).Range("A" & myL & "").Copy Worksheets("Sheet1").Range("B3")
End If
End Sub
recording FROM respective sheets changes the value in B3 thus execute the recording TO respective sheets again... the former is essential, how to stop the latter ?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myWS As String ' gets the form/year that is similar to sheet to copy/record
myWS = Sheet1.Range("B1").Value ' say F1 (sheet name)
Dim myL As String ' gets the lesson num in sow
myL = Sheet1.Range("B2").Value ' say 1
If Not Intersect(Target, Range("B3:B11")) Is Nothing Then ' recording to respectives sheets
Worksheets("Sheet1").Range("B3").Copy Worksheets(myWS).Range("A" & myL & "") 'copy to sheet F1 cell A1
End If
If Not Intersect(Target, Range("B1:B2")) Is Nothing Then ' recording from respective sheets
Worksheets(myWS).Range("A" & myL & "").Copy Worksheets("Sheet1").Range("B3")
End If
End Sub