I created a macro to copy data from one worksheet and paste it to a different worksheet. The macro below works fine when I run it from a "module" (terminology ?). However, when I run the macro from an event driven macro (like from combo box), the macro bombs.
I was able to get the macro to work by having the event driven macro just call the module macro, but I would like to understand what is going on. I suspect that it's related to variable scope, but I am a newbie wrt Excel Macros.
Any ideas ?
I have also attached a sample workbook.
Thanks in Advance.
RW
***********
Macro is below
***********
Sub Macro1()
Sheets("Sheet2").Select
Range("E6:E9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet5").Select
Range("H7").Select
ActiveSheet.Paste
End Sub
Please read forum rules and wrap your code
Bookmarks