I am having trouble running a macro that copies data range (source) from one worksheet to the main worksheet (destination) based on a value selected in a cell in the destination worksheet. The copy sub works fine when ran separately, but when I try to call the sub based on a worksheet sub the copy paste fails. I know I am probably missing something very simple but can't quite get it. Here are the two code sets:
Worksheet Sub:
Sub worksheet_change(ByVal target As Range)
Set target = Range("D2")
If target.Value = "BEO" Then
Call BEO
End If
End Sub
Module Sub:
Sub BEO()
Sheets("data").Select
ActiveSheet.Range("N24:P25").Select
Selection.Copy
Sheets("Configuration").Select
ActiveSheet.Range("E1").Select
Selection.PasteSpecial Paste:=xlPasteAll
Application.CutCopyMode = False
End Sub
I am trying to initiate Module sub to run based on value in cell.