#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Run macros macro

I recorded the following macro to run three other macros. The code references
a particular workbook name. How do I change that so it will run in any
workbook

Thanks so much.

Sub CBRunMacros()
'
' CBRunMacros Macro
'

'
Application.CutCopyMode = False
Application.Run "'DFC MUSA AR Credit Balances 013107.xls'!CBcellformat"
Application.Run _
"'DFC MUSA AR Credit Balances 013107.xls'!mcrInsertTwoRowsOnEmpty"
Application.Run "'DFC MUSA AR Credit Balances 013107.xls'!CBSubtotal"
Columns("F:F").EntireColumn.AutoFit
Columns("G:G").EntireColumn.AutoFit
Columns("I:I").EntireColumn.AutoFit
Columns("J:J").EntireColumn.AutoFit
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200702/1

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Run macros macro

try just taking out the workbook reference, i.e.
Application.Run "CBcellformat"

Hope this helps,
-Chad

"blazzzercat via OfficeKB.com" wrote:

I recorded the following macro to run three other macros. The code references
a particular workbook name. How do I change that so it will run in any
workbook

Thanks so much.

Sub CBRunMacros()
'
' CBRunMacros Macro
'

'
Application.CutCopyMode = False
Application.Run "'DFC MUSA AR Credit Balances 013107.xls'!CBcellformat"
Application.Run _
"'DFC MUSA AR Credit Balances 013107.xls'!mcrInsertTwoRowsOnEmpty"
Application.Run "'DFC MUSA AR Credit Balances 013107.xls'!CBSubtotal"
Columns("F:F").EntireColumn.AutoFit
Columns("G:G").EntireColumn.AutoFit
Columns("I:I").EntireColumn.AutoFit
Columns("J:J").EntireColumn.AutoFit
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200702/1


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Run macros macro

Works great thanks!

Chad wrote:
try just taking out the workbook reference, i.e.
Application.Run "CBcellformat"

Hope this helps,
-Chad

I recorded the following macro to run three other macros. The code references
a particular workbook name. How do I change that so it will run in any

[quoted text clipped - 18 lines]
Columns("J:J").EntireColumn.AutoFit
End Sub


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200702/1

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
Enable Macros with a Macro! Mark[_2_] Excel Discussion (Misc queries) 3 February 21st 07 06:26 PM
Macro warning even though macros have been removed. Stu Excel Discussion (Misc queries) 2 January 3rd 07 03:25 PM
Macro Msg. when file has no macros Stilla Excel Worksheet Functions 2 February 9th 06 03:10 PM
Excel says macro, but no macros present? Pho Excel Discussion (Misc queries) 2 November 15th 05 02:09 AM
macro warning - but no macros GJR3599 Excel Discussion (Misc queries) 1 April 13th 05 08:15 PM


All times are GMT +1. The time now is 09:45 AM.

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

About Us

"It's about Microsoft Excel"