Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Runing two macros triggered by a button

If you only use cellinfooter when you click that button:

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

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

If you want to be able to use cellinfooter independently of the button:

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
call cellinfooter
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

JackR wrote:

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


--

Dave Peterson
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
Runing two macros triggered by a button Paul B Excel Discussion (Misc queries) 1 December 9th 05 12:51 AM
1 button for 2 macros lunker55 Excel Discussion (Misc queries) 5 June 20th 05 06:25 PM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 7 March 7th 05 06:29 PM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 0 February 28th 05 06:26 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:23 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"