Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Losing Macro When Coping Sheets into a New Book

I have a master spreadsheet that I'm using to create and send forms to
different people. Once they receive the form, I want them to complete it and
send it back to me.

However when I do this, I'm copying the form from a blank template in one
file into a new book. The button on the new file still refers back to the
macro on the orginal file, not the Macro on New file. (I placed the macro on
the sheet itself) Is there a way to get around this? Or maybe move a module
from one book to another through a macro? Any help would be greatly
appreciated
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Losing Macro When Coping Sheets into a New Book

Hi Vick

Use a button from the control toolbox and add your code in the
click event of the button in the sheet module.


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Vick" wrote in message ...
I have a master spreadsheet that I'm using to create and send forms to
different people. Once they receive the form, I want them to complete it and
send it back to me.

However when I do this, I'm copying the form from a blank template in one
file into a new book. The button on the new file still refers back to the
macro on the orginal file, not the Macro on New file. (I placed the macro on
the sheet itself) Is there a way to get around this? Or maybe move a module
from one book to another through a macro? Any help would be greatly
appreciated

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 63
Default Losing Macro When Coping Sheets into a New Book

Thanks a bunch, that was so simple, I feel stupid for asking the question. I
did have another question however.

In the code on the control button I have it opening up a new file and trying
to select a cell in that file, but I keep getting a Application-defined or
object-defined error when it gets to the range selection. I've included the
code below.

Workbooks.Open Filename:="C:\Share\Tracking\Tracking Form.xls"
Range("A1").Select

Thanks again.

"Ron de Bruin" wrote:

Hi Vick

Use a button from the control toolbox and add your code in the
click event of the button in the sheet module.


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Vick" wrote in message ...
I have a master spreadsheet that I'm using to create and send forms to
different people. Once they receive the form, I want them to complete it and
send it back to me.

However when I do this, I'm copying the form from a blank template in one
file into a new book. The button on the new file still refers back to the
macro on the orginal file, not the Macro on New file. (I placed the macro on
the sheet itself) Is there a way to get around this? Or maybe move a module
from one book to another through a macro? Any help would be greatly
appreciated


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Losing Macro When Coping Sheets into a New Book

Try this

Dim wb2 As Workbook
Set wb2 = Workbooks.Open(Filename:="C:\Share\Tracking\Tracki ng Form.xls")
Application.Goto wb2.Worksheets(1).Range("A1")


I use the first worksheet now

Application.Goto wb2.Worksheets(1).Range("A1")

But you can also use a sheet name

Application.Goto wb2.Worksheets("YourSheetName").Range("A1")


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Vick" wrote in message ...
Thanks a bunch, that was so simple, I feel stupid for asking the question. I
did have another question however.

In the code on the control button I have it opening up a new file and trying
to select a cell in that file, but I keep getting a Application-defined or
object-defined error when it gets to the range selection. I've included the
code below.

Workbooks.Open Filename:="C:\Share\Tracking\Tracking Form.xls"
Range("A1").Select

Thanks again.

"Ron de Bruin" wrote:

Hi Vick

Use a button from the control toolbox and add your code in the
click event of the button in the sheet module.


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Vick" wrote in message ...
I have a master spreadsheet that I'm using to create and send forms to
different people. Once they receive the form, I want them to complete it and
send it back to me.

However when I do this, I'm copying the form from a blank template in one
file into a new book. The button on the new file still refers back to the
macro on the orginal file, not the Macro on New file. (I placed the macro on
the sheet itself) Is there a way to get around this? Or maybe move a module
from one book to another through a macro? Any help would be greatly
appreciated


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems Coping and moving sheets between files Excell 2007 [email protected] Excel Discussion (Misc queries) 2 November 23rd 07 04:37 PM
can I sort the order of sheets in a book? The Life Coach Excel Discussion (Misc queries) 1 November 2nd 07 03:51 PM
I am losing comments when i merge work sheets? Any one know how t Martin Stephenson Excel Discussion (Misc queries) 0 June 1st 06 05:25 PM
Macro for part of W/book sheets TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 March 9th 06 05:57 AM
How do I reconcile two sheets with in a .xls book? momy2cmt New Users to Excel 2 December 28th 05 03:15 PM


All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"