Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Runing two macros triggered by a button | Excel Discussion (Misc queries) | |||
1 button for 2 macros | Excel Discussion (Misc queries) | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Macro to simply bring up the Find dialogue box?? | Excel Discussion (Misc queries) |