Combine Macros

D

Dorci

I can't seem to combine the steps in 2 macros. I have Macro1 and Macro2
(below), which both work independently, but when I add the steps from Macro2
to Macro1, only the original portion of Macro1 actually runs.

THIS WORKS:
Sub Macro1()
With ActiveWindow.Selection.ShapeRange
.Height = 43.12
.Width = 719.75
.Left = 0#
.Top = 35.88
.TextFrame.TextRange.Font.Size = 26
End With
End Sub

AND THIS WORKS:
Sub Macro2()
With ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Font
.Color.RGB = RGB(Red:=51, Green:=102, Blue:=153)
End With
End Sub

BUT WHEN I DO THIS:
Sub Macro1()
With ActiveWindow.Selection.ShapeRange
.Height = 43.12
.Width = 719.75
.Left = 0#
.Top = 35.88
.TextFrame.TextRange.Font.Size = 26
End With
With ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Font
.Color.RGB = RGB(Red:=51, Green:=102, Blue:=153)
End With
End Sub

OR THIS:
Sub Macro1()
With ActiveWindow.Selection.ShapeRange
.Height = 43.12
.Width = 719.75
.Left = 0#
.Top = 35.88
.TextFrame.TextRange.Font.Size = 26
.TextFrame.TextRange.Font.Color.RGB = RGB(Red:=51, Green:=102,
Blue:=153)
End With
End Sub

ALL OF THE OTHER LINES WORK, BUT THE FONT COLOR CHANGE DOES NOT.

Any idea why? Thanks in advance.
-Dorci
 
D

David M. Marcovitz

That's strange. It works for me just fine. I used your last macro, and
it worked fine (just being sure to fix the wrapping so that Blue:=153 is
on the same line as the previous stuff).
--David
 
D

Dorci

Okay, now I know what the REAL problem is (sorta). You're right, the
combined macro DOES work. But the custom button I assigned it to DIDN'T and
that was how I was running it. I ditched the button and made a new one, and
now all's fine.

Thanks so much for your prompt response. This is going to save me SO MUCH
time (I have to reformat several presentations).
 

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