PC Review


Reply
Thread Tools Rate Thread

Copying a macro to use in another workbook

 
 
Liz C
Guest
Posts: n/a
 
      26th Oct 2009
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!

 
Reply With Quote
 
 
 
 
Liz C
Guest
Posts: n/a
 
      26th Oct 2009
Never mind. I figured out what my problem was.

Thanks!

Liz

"Liz C" wrote:

> 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!
>

 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      27th Oct 2009
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.



"Liz C" wrote:

> Never mind. I figured out what my problem was.
>
> Thanks!
>
> Liz
>
> "Liz C" wrote:
>
> > 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!
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying worksheet to another workbook with a macro more than once =?Utf-8?B?UlQ=?= Microsoft Excel Programming 2 13th Nov 2007 04:29 PM
Macro for Copying Worksheet to New Workbook =?Utf-8?B?TUdD?= Microsoft Excel Misc 10 17th Aug 2007 01:57 AM
Macro Copying To Another Workbook?? countryfan_nt Microsoft Excel Programming 2 3rd Apr 2005 02:38 PM
copying macro to a new workbook JT Microsoft Excel Programming 3 15th Dec 2004 06:16 PM
Re: Copying macro with workbook. Bernie Deitrick Microsoft Excel Worksheet Functions 1 31st Mar 2004 07:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:31 AM.