Loki-MakerOfMischief
New Member
- Joined
- May 8, 2003
- Messages
- 29
Hello Folks,
I have a large database with lots of macros that I have set up for a user (tied to buttons). I am using Excel 2000, Win NT. The user has Excel 97, Win 98. There are 2 problems that I am having. They are:
1) The buttons are not showing up on the users machine; and
2) The macros are not working the exact same between the different versions. It ends up cutting out half way through the macro. The macro in question is as follows:
If more info is needed please let me know.
Any comments and / or help are always appreciated.
Thanks,
Loki
I have a large database with lots of macros that I have set up for a user (tied to buttons). I am using Excel 2000, Win NT. The user has Excel 97, Win 98. There are 2 problems that I am having. They are:
1) The buttons are not showing up on the users machine; and
2) The macros are not working the exact same between the different versions. It ends up cutting out half way through the macro. The macro in question is as follows:
Code:
Sub Entered()
Dim printer_warning
printer_warning = MsgBox("Please make sure the Printer is turned ON and there is paper loaded." & vbCr & Space(10) & "If the Printer is ON and there is paper loaded, Click OK..." & vbCr & Space(35) & "Otherwise click CANCEL", vbExclamation + vbOKCancel + vbDefaultButton1, Space(40) & "WARNING!")
' If user selects Cancel then stop macro and return to the spreadsheet
If warning = vbCancel Then Exit Sub
' Filter database to show only records that were entered today
Rows("6:6").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.AutoFilter
ActiveWindow.ScrollColumn = 252
Selection.AutoFilter Field:=255, Criteria1:=Format(Now(), "dd/mm/yyyy")
' Hide Columns
Columns("D:M").Select
Selection.EntireColumn.Hidden = True
Columns("P:R").Select
Selection.EntireColumn.Hidden = True
Columns("U:IV").Select
Selection.EntireColumn.Hidden = True
' Hide Rows
Rows("1:5").Select
Selection.EntireRow.Hidden = True
Application.ScreenUpdating = False
' Start at Cell A8 and Select all Rows down with Data in them
Range(Range("A8"), Range("A" & Rows.Count).End(xlUp)).EntireRow.Select
' Sort by Cell B8 (Last Name) and then by C8 (First Name)
Selection.Sort Key1:=Range("B8"), Order1:=xlAscending, Key2:=Range("C8"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
' Start at Cell A8 and Select all Rows down with Data in them
Range(Range("A6"), Range("A" & Rows.Count).End(xlUp)).EntireRow.Select
Range(Selection, Selection.End(xlDown)).Select
With ActiveSheet.PageSetup
' Set Print Area
.PrintArea = ""
' Printing Parameters
' Prints Rows 6 & 7 as the Title Row
.PrintTitleRows = Rows("6:7").Address
' Print a Custom Header in the Center
.CenterHeader = "Clients Entered on &D"
' Print a Custom Footer ... File Name on the left & Print Date & Time on the right
.LeftFooter = "&F"
.RightFooter = "Printed &D at &T"
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.TopMargin = Application.InchesToPoints(0.78740157480315)
.BottomMargin = Application.InchesToPoints(0.78740157480315)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.Orientation = xlLandscape
.PaperSize = xlPaperLetter
.CenterHorizontally = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveSheet.PrintOut Copies:=1, Collate:=True
' "Turns off" the Custom Header
ActiveSheet.PageSetup.CenterHeader = ""
' Turn AutoFilter OFF
Selection.AutoFilter
' Un-Hide Columns
Cells.Select
Selection.EntireColumn.Hidden = False
' Un-Hide Rows
Rows("1:5").Select
Selection.EntireRow.Hidden = False
Range("B8").Select
Application.ScreenUpdating = True
End Sub
If more info is needed please let me know.
Any comments and / or help are always appreciated.
Thanks,
Loki