Hello,
Im having a weird problem and hopefully someone might be able to help. When triggered my macro copies:
Sheet 2 to Sheet
Then Sheet 1 to Sheet 2
It has to be in that order. I wrote my Macro, the problem is when I execute it the Macro isn't working but the catch is, VBE is not giving me any errors. I was hoping someone might be able to provide some insight as to why it isn't working. Here is my code
Thank you all!
Im having a weird problem and hopefully someone might be able to help. When triggered my macro copies:
Sheet 2 to Sheet
Then Sheet 1 to Sheet 2
It has to be in that order. I wrote my Macro, the problem is when I execute it the Macro isn't working but the catch is, VBE is not giving me any errors. I was hoping someone might be able to provide some insight as to why it isn't working. Here is my code
Code:
Option Explicit
Sub First()
Public Function CopySheet2(M1 As String, M2 As String)
Dim M1 As String
Sheets("Sheet2").Range("A2:P18").Copy Destination:=Sheets("Sheet3").Range("A2")
'Copy the data
Sheets("Sheet2").Range("A2:P18").Copy
'Activate the destination worksheet
Sheets("Sheet3").Activate
'Select the target range
Range("A2").Select
'Paste in the target destination
ActiveSheet.Paste
Application.CutCopyMode = False
End Function
Public Function CopySheet1(M1 As String, M2 As String)
Dim M2 As String
Sheets("Sheet1").Range("A2:P18").Copy Destination:=Sheets("Sheet2").Range("A2")
'Copy the data
Sheets("Sheet1").Range("A2:P18").Copy
'Activate the destination worksheet
Sheets("Sheet2").Activate
'Select the target range
Range("A2").Select
'Paste in the target destination
ActiveSheet.Paste
Application.CutCopyMode = False
End Function
End Sub
Thank you all!