Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am attempting to trigger a macro within a macro. The code I am using limits
me to the current file name as opposed to the "Active Sheet". The current file name in this case is "New Customer" but in the way that I want to use this macro it could be any file name, i.e. "Doe, John". In light of my elementary code below what can I change to allow this macro to trigger for the "Active Sheet" so that the file can be any name. Here is how the code reads now. Thanks: Sub RunPasteFinal() ' ' RunPasteFinal Macro ' Macro recorded 4/10/2006 by _ ' ' Application.Run "'New Customer.xls'!PasteFromFinal" End Sub -- David P. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this line instead...........
Call PasteFromFinal hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: I am attempting to trigger a macro within a macro. The code I am using limits me to the current file name as opposed to the "Active Sheet". The current file name in this case is "New Customer" but in the way that I want to use this macro it could be any file name, i.e. "Doe, John". In light of my elementary code below what can I change to allow this macro to trigger for the "Active Sheet" so that the file can be any name. Here is how the code reads now. Thanks: Sub RunPasteFinal() ' ' RunPasteFinal Macro ' Macro recorded 4/10/2006 by _ ' ' Application.Run "'New Customer.xls'!PasteFromFinal" End Sub -- David P. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Si, voy con Dios!
Thank you Chuck. Revealing my novice level with Excel & Visual Basic, 1) Where in the code do I put "Call PasteFinal"? 2) Do I put a space between "Call" & "PasteFinal"? 3) Do I put "Call Paste Final" in more than 1 part of the code? -- David P. "CLR" wrote: Try this line instead........... Call PasteFromFinal hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: I am attempting to trigger a macro within a macro. The code I am using limits me to the current file name as opposed to the "Active Sheet". The current file name in this case is "New Customer" but in the way that I want to use this macro it could be any file name, i.e. "Doe, John". In light of my elementary code below what can I change to allow this macro to trigger for the "Active Sheet" so that the file can be any name. Here is how the code reads now. Thanks: Sub RunPasteFinal() ' ' RunPasteFinal Macro ' Macro recorded 4/10/2006 by _ ' ' Application.Run "'New Customer.xls'!PasteFromFinal" End Sub -- David P. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry David...........
Just replace your line that reads........ Application.Run "'New Customer.xls'!PasteFromFinal" with this line........ Call PasteFromFinal and yes, there is a space between Call and PasteFromfinal You need only one entry of "Call PasteFromFinal" to run the "PasteFromFinal" macro, but you can do it as many times as you wish, like if you want to do other stuff in between times....... hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: Si, voy con Dios! Thank you Chuck. Revealing my novice level with Excel & Visual Basic, 1) Where in the code do I put "Call PasteFinal"? 2) Do I put a space between "Call" & "PasteFinal"? 3) Do I put "Call Paste Final" in more than 1 part of the code? -- David P. "CLR" wrote: Try this line instead........... Call PasteFromFinal hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: I am attempting to trigger a macro within a macro. The code I am using limits me to the current file name as opposed to the "Active Sheet". The current file name in this case is "New Customer" but in the way that I want to use this macro it could be any file name, i.e. "Doe, John". In light of my elementary code below what can I change to allow this macro to trigger for the "Active Sheet" so that the file can be any name. Here is how the code reads now. Thanks: Sub RunPasteFinal() ' ' RunPasteFinal Macro ' Macro recorded 4/10/2006 by _ ' ' Application.Run "'New Customer.xls'!PasteFromFinal" End Sub -- David P. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you for your patience. What I think I need to add into my code is a way
to temporarily mark the pertinent worksheet the "active worksheet" so that the correct sheet is activated in order for the "Call PasteFromFinal" will work. I believe this isn't working because I need to tell it what sheet I want the macro to run on but the thing is the file name for that worksheet will vary (each file is save under our customer's last name, first name). Any suggestions? -- David P. "CLR" wrote: Sorry David........... Just replace your line that reads........ Application.Run "'New Customer.xls'!PasteFromFinal" with this line........ Call PasteFromFinal and yes, there is a space between Call and PasteFromfinal You need only one entry of "Call PasteFromFinal" to run the "PasteFromFinal" macro, but you can do it as many times as you wish, like if you want to do other stuff in between times....... hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: Si, voy con Dios! Thank you Chuck. Revealing my novice level with Excel & Visual Basic, 1) Where in the code do I put "Call PasteFinal"? 2) Do I put a space between "Call" & "PasteFinal"? 3) Do I put "Call Paste Final" in more than 1 part of the code? -- David P. "CLR" wrote: Try this line instead........... Call PasteFromFinal hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: I am attempting to trigger a macro within a macro. The code I am using limits me to the current file name as opposed to the "Active Sheet". The current file name in this case is "New Customer" but in the way that I want to use this macro it could be any file name, i.e. "Doe, John". In light of my elementary code below what can I change to allow this macro to trigger for the "Active Sheet" so that the file can be any name. Here is how the code reads now. Thanks: Sub RunPasteFinal() ' ' RunPasteFinal Macro ' Macro recorded 4/10/2006 by _ ' ' Application.Run "'New Customer.xls'!PasteFromFinal" End Sub -- David P. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi David.......
Maybe this....... Sheets("PertinentWorksheetName").Select Call PasteFromFinal If not, post your macro and explain what it does that you don't want it to, and/or what it don't do that you want it to do........ Vaya con Dios, Chuck, CABGx3 "David P." wrote: Thank you for your patience. What I think I need to add into my code is a way to temporarily mark the pertinent worksheet the "active worksheet" so that the correct sheet is activated in order for the "Call PasteFromFinal" will work. I believe this isn't working because I need to tell it what sheet I want the macro to run on but the thing is the file name for that worksheet will vary (each file is save under our customer's last name, first name). Any suggestions? -- David P. "CLR" wrote: Sorry David........... Just replace your line that reads........ Application.Run "'New Customer.xls'!PasteFromFinal" with this line........ Call PasteFromFinal and yes, there is a space between Call and PasteFromfinal You need only one entry of "Call PasteFromFinal" to run the "PasteFromFinal" macro, but you can do it as many times as you wish, like if you want to do other stuff in between times....... hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: Si, voy con Dios! Thank you Chuck. Revealing my novice level with Excel & Visual Basic, 1) Where in the code do I put "Call PasteFinal"? 2) Do I put a space between "Call" & "PasteFinal"? 3) Do I put "Call Paste Final" in more than 1 part of the code? -- David P. "CLR" wrote: Try this line instead........... Call PasteFromFinal hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: I am attempting to trigger a macro within a macro. The code I am using limits me to the current file name as opposed to the "Active Sheet". The current file name in this case is "New Customer" but in the way that I want to use this macro it could be any file name, i.e. "Doe, John". In light of my elementary code below what can I change to allow this macro to trigger for the "Active Sheet" so that the file can be any name. Here is how the code reads now. Thanks: Sub RunPasteFinal() ' ' RunPasteFinal Macro ' Macro recorded 4/10/2006 by _ ' ' Application.Run "'New Customer.xls'!PasteFromFinal" End Sub -- David P. |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi David...........
Maybe this is what you are looking for.........with the "Pertinent Sheet" name in cell A1, this macro will take you to it, assuming it exists, and then run your "PasteFromFinal" macro..... Sub SwitchSheetToCellValue() Dim PertinentSheet PertinentSheet = Range("a1").Value Worksheets(PertinentSheet).Select Call PasteFromFinal End Sub hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: Thank you for your patience. What I think I need to add into my code is a way to temporarily mark the pertinent worksheet the "active worksheet" so that the correct sheet is activated in order for the "Call PasteFromFinal" will work. I believe this isn't working because I need to tell it what sheet I want the macro to run on but the thing is the file name for that worksheet will vary (each file is save under our customer's last name, first name). Any suggestions? -- David P. "CLR" wrote: Sorry David........... Just replace your line that reads........ Application.Run "'New Customer.xls'!PasteFromFinal" with this line........ Call PasteFromFinal and yes, there is a space between Call and PasteFromfinal You need only one entry of "Call PasteFromFinal" to run the "PasteFromFinal" macro, but you can do it as many times as you wish, like if you want to do other stuff in between times....... hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: Si, voy con Dios! Thank you Chuck. Revealing my novice level with Excel & Visual Basic, 1) Where in the code do I put "Call PasteFinal"? 2) Do I put a space between "Call" & "PasteFinal"? 3) Do I put "Call Paste Final" in more than 1 part of the code? -- David P. "CLR" wrote: Try this line instead........... Call PasteFromFinal hth Vaya con Dios, Chuck, CABGx3 "David P." wrote: I am attempting to trigger a macro within a macro. The code I am using limits me to the current file name as opposed to the "Active Sheet". The current file name in this case is "New Customer" but in the way that I want to use this macro it could be any file name, i.e. "Doe, John". In light of my elementary code below what can I change to allow this macro to trigger for the "Active Sheet" so that the file can be any name. Here is how the code reads now. Thanks: Sub RunPasteFinal() ' ' RunPasteFinal Macro ' Macro recorded 4/10/2006 by _ ' ' Application.Run "'New Customer.xls'!PasteFromFinal" End Sub -- David P. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |