zoom38
02-12-2006, 06:21 PM
I'm trying to make a button on the workbook that will activate a macro. I tried using Excel help but I still cant figure it out. I want this button to go with the workbook so others may use it when I send them the file. When you press the button I want it to call "Main" which runs the code.
Public Sub Main()
Application.ScreenUpdating = False
Dim rngStart As Range
Set rngStart = Selection
Sheets("Tables").Activate
' Sheets("Tables").Select
First_Shift_Sort
Flex_Shift_Sort
Second_Shift_Sort
SD_Sort
With rngStart
.Parent.Activate
.Select
End With
Application.ScreenUpdating = True
End Sub
Thanks
Gary
Public Sub Main()
Application.ScreenUpdating = False
Dim rngStart As Range
Set rngStart = Selection
Sheets("Tables").Activate
' Sheets("Tables").Select
First_Shift_Sort
Flex_Shift_Sort
Second_Shift_Sort
SD_Sort
With rngStart
.Parent.Activate
.Select
End With
Application.ScreenUpdating = True
End Sub
Thanks
Gary