LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Paul B
 
Posts: n/a
Default Runing two macros triggered by a button

Jack, why not just put them together in one,

Sub nametab()
Dim i As Integer
On Error Resume Next
For i = 1 To Sheets.Count
Sheets(i).Name = Sheets(i).Range("G1").Value
Next i
With ActiveSheet
.PageSetup.CenterFooter = .Range("G1").Text
End With
On Error GoTo 0
End Sub


or like this

Sub nametab()
Dim i As Integer
On Error Resume Next
For i = 1 To Sheets.Count
Sheets(i).Name = Sheets(i).Range("G1").Value
Next i
With ActiveSheet
.PageSetup.CenterFooter = .Range("G1").Text
End With
CellInfooter
On Error GoTo 0
End Sub

Sub CellInfooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("G1").Text
End With
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"JackR" wrote in message
...
I have the first macro set-up to start when a button is clicked, I would

like
bothe the macros to run when then button is clicked, any help would be

great,
not real up on this macro stuff yet.

MACRO 1 (triggered by button)
Sub nametab()
Dim i As Integer
On Error Resume Next
For i = 1 To Sheets.Count
Sheets(i).Name = Sheets(i).Range("G1").Value
Next i
On Error GoTo 0
End Sub

WANT TO ADD THE FOLLOWING TO TRIGGER AT THE SAME TIME
Sub CellInfooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("G1").Text
End With
End Sub



Thanks



 
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
1 button for 2 macros lunker55 Excel Discussion (Misc queries) 5 June 20th 05 06:25 PM
Command Button anomalies RWN Excel Discussion (Misc queries) 5 May 4th 05 05:09 AM
sorting with macros Sorting in macros Excel Discussion (Misc queries) 1 February 1st 05 09:02 AM
Command Button VBA code Dave Peterson Excel Discussion (Misc queries) 2 January 25th 05 11:28 PM
Macro to simply bring up the Find dialogue box?? marika1981 Excel Discussion (Misc queries) 14 January 14th 05 10:47 PM


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

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"