Copying a macro to use in another workbook

L

Liz C

I have the following macro I'm using in a workbook and would like to use it
in another workbook.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
Rows(Target.Row).Interior.ColorIndex = 17
Columns(Target.Column).Interior.ColorIndex = 17
End Sub

Will someone please tell me how to copy it to use in the other workbook?

Thank you in advance for your help!
 
P

Patrick Molloy

apart from copy/paste , yuo can "drag" code modules from one project to
another -- useful if yuo need to rebuild workbooks or re-use useful code.
You can also drag a module onto your desktop and back into a project from
the desktop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top