Run macros macro

  • Thread starter blazzzercat via OfficeKB.com
  • Start date
B

blazzzercat via OfficeKB.com

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
 
G

Guest

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

Hope this helps,
-Chad
 
D

Don Guillett

IF?? the macro is in the workbook try

CBRunMacros Macro()

CBcellformat
mcrInsertTwoRowsOnEmpty
CBSubtotal

range("f1,g1,i1,j1").EntireColumn.AutoFit
End Sub
 
B

blazzzercat via OfficeKB.com

Works great thanks!
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
 

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