以下是引用zz5151353在2006-12-2 10:45:34的发言:ANDYSKY 兄 , 好人做到底 請把原碼傳 EMAIL 到小弟信箱 tsenglkl@hotmail.com 讓小弟學習 , 謝謝您 !!! 請大家 提供4處紅色正確文字 , 謝謝 !!!
Option Explicit Public nextRun As Date '************************************************************************* '**╭⌒╮⌒╮ ︸ ︷ ﹀ ︿ '**╱◥██◣ Home ﹀ ︷ ︸ '**|田|田 田|﹏﹏﹏﹏﹏﹏﹏﹏﹏﹏﹏﹏ '**╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬ '**Mail:andy@zs-futai.com '************************************************************************* Private Sub CommandButton5_Click() Dim 查找值, introws As Integer, i As Byte, c As Range, firstAddress Dim arr() Application.ScreenUpdating = False On Error Resume Next 查找值 = Me.TextBox2.Text introws = 0 For i = 3 To Sheets.Count Set c = Sheets(i).Range("c2:c1000").Find(what:=查找值) If Not c Is Nothing Then firstAddress = c.Address Do introws = introws + 1 ReDim Preserve arr(1 To 4, 1 To introws) arr(1, introws) = c.Value arr(2, introws) = c.Offset(0, 1).Text arr(3, introws) = c.Offset(0, 2).Text arr(4, introws) = c.Offset(0, 3).Text Set c = Sheets(i).Range("c2:c1000").FindNext(c) Loop While Not c Is Nothing And c.Address <> firstAddress End If Next With Me.ListBox1 .ColumnCount = 4 '共显示4列 .Clear .MatchEntry = fmMatchEntryNone '单选按钮 .MultiSelect = fmMultiSelectSingle '只能单选取 .Height = 245 .List = Application.Transpose(arr) .Width = 537 End With Application.ScreenUpdating = True End Sub Private Sub Label1_Click() Sheets("内部人员").Visible = True Sheets("内部人员").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label1.BackColor = &HFF& Me.Label1.ForeColor = &HFFFF80 End Sub Private Sub Label2_Click() Sheets("采购厂商").Visible = True Sheets("采购厂商").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label2.BackColor = &HFF& Me.Label2.ForeColor = &HFFFF80 End Sub Private Sub Label3_Click() Sheets("珠海旭泰").Visible = True Sheets("珠海旭泰").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label3_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label3.BackColor = &HFF& Me.Label3.ForeColor = &HFFFF80 End Sub Private Sub Label4_Click() Sheets("中山客户").Visible = True Sheets("中山客户").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label4_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label4.BackColor = &HFF& Me.Label4.ForeColor = &HFFFF80 End Sub Private Sub Label5_Click() Sheets("广州南海").Visible = True Sheets("广州南海").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label5_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label5.BackColor = &HFF& Me.Label5.ForeColor = &HFFFF80 End Sub Private Sub Label6_Click() Sheets("东莞客户").Visible = True Sheets("东莞客户").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label6_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label6.BackColor = &HFF& Me.Label6.ForeColor = &HFFFF80 End Sub Private Sub Label7_Click() Sheets("珠海客户").Visible = True Sheets("珠海客户").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label7_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label7.BackColor = &HFF& Me.Label7.ForeColor = &HFFFF80 End Sub Private Sub Label8_Click() Sheets("深圳客户").Visible = True Sheets("深圳客户").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label8_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label8.BackColor = &HFF& Me.Label8.ForeColor = &HFFFF80 End Sub Private Sub Label9_Click() Sheets("外省客户").Visible = True Sheets("外省客户").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub Label9_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) Me.Label9.BackColor = &HFF& Me.Label9.ForeColor = &HFFFF80 End Sub Private Sub Label10_Click() Sheets("模具部专用").Visible = True Sheets("模具部专用").Activate Application.CommandBars("Standard").Visible = False Application.CommandBars("Formatting").Visible = False Application.CommandBars("Drawing").Visible = False Application.DisplayFormulaBar = False Unload Me End Sub Private Sub 备份资料_Click() On Error Resume Next AppActivate (Shell("C:\WINDOWS\system32\ntbackup.exe")) End Sub Private Sub 关闭EXCEL_Click() Application.Quit End Sub Private Sub 关闭电脑_Click() Shell "SHUTDOWN.EXE /F /S /T 0" End Sub Private Sub 计算器_Click() AppActivate (Shell("C:\WINDOWS\system32\CALC.EXE")) End Sub Private Sub 缩小窗口_Click() Application.WindowState = xlMinimized End Sub Private Sub 日记本_Click() AppActivate (Shell("C:\WINDOWS\system32\notepad.exe")) End Sub Private Sub 特殊字符输入_Click() AppActivate (Shell("C:\WINDOWS\system32\charmap.exe")) End Sub Private Sub 修改_Click() Me.TextBox3.Locked = False Me.TextBox4.Locked = False Me.TextBox5.Locked = False Me.TextBox6.Locked = False Me.TextBox7.Locked = False Me.TextBox8.Locked = False Me.TextBox9.Locked = False Me.TextBox10.Locked = False Me.TextBox11.Locked = False Me.TextBox12.Locked = False Me.TextBox13.Locked = False Me.TextBox14.Locked = False Me.TextBox15.Locked = False Me.TextBox16.Locked = False End Sub Private Sub 修改屏保_Click() Call Shell("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1", 9) End Sub Private Sub 资源管理器_Click() On Error Resume Next AppActivate (Shell("C:\WINDOWS\explorer.exe")) End Sub
|