بحث مخصص من جوجل فى أوفيسنا
Custom Search
|
البحث في الموقع
Showing results for tags 'mousehoover'.
تم العثور علي 1 نتيجه
-
السلام عليكم ملف للتحميل : https://app.box.com/s/v94a80af0wlm284d057fhqsjeqxdpd1y الكود التالي يعتمد طريقة فريدة و غريبة بواسطة دالة ال HYPERLINK 1- الكود في موديول عادي : Option Explicit Private Type POINTAPI x As Long y As Long End Type #If VBA7 And Win64 Then Private Declare PtrSafe Function GetCursorPos Lib "User32" (lpPoint As POINTAPI) As Long #Else Private Declare Function GetCursorPos Lib "USER32" (lpPoint As POINTAPI) As Long #End If Private ThisCell As Range Private myShape As Shape Private linitialColorIndex As Long Private linitialFontColorIndex As Long Public Sub MyMouseOverEvent_Hyplnk() Set ThisCell = Application.Caller With ThisCell Set ThisWorkbook.oWsh = .Worksheet If .Interior.ColorIndex = 6 Then .Interior.ColorIndex = linitialColorIndex If .Font.ColorIndex = 3 Then .Font.ColorIndex = linitialFontColorIndex linitialColorIndex = .Interior.ColorIndex linitialFontColorIndex = .Font.ColorIndex .Interior.ColorIndex = 6 .Font.ColorIndex = 3 Set myShape = .Parent.Shapes(Replace(.Name.Name, "_", "")) myShape.Left = .Offset(0, 2).Left + 2 myShape.Top = .Offset(0, 2).Top + 1 myShape.Width = .Offset(0, 2).Width - 2 myShape.Height = .Offset(0, 2).Height - 2 myShape.OnAction = "Dummy" myShape.Visible = msoTrue Call MouseExit End With End Sub Private Sub Dummy() End Sub Private Sub MouseExit() Dim tPt As POINTAPI Do GetCursorPos tPt If TypeName(ActiveWindow.RangeFromPoint(tPt.x, tPt.y)) <> "Range" Then Exit Do If ThisCell.Address <> ActiveWindow.RangeFromPoint(tPt.x, tPt.y).Address Then Exit Do DoEvents Loop ThisCell.Interior.ColorIndex = linitialColorIndex ThisCell.Font.ColorIndex = linitialFontColorIndex Set ThisCell = Nothing myShape.Visible = msoFalse End Sub 2- الكود في ThisWorkbook Module : Option Explicit Public WithEvents oWsh As Worksheet Private Sub Workbook_Open() Set oWsh = Sheets(1) End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim oShp As Shape On Error Resume Next For Each oShp In oWsh.Shapes oShp.Visible = msoFalse Next End Sub Private Sub oWsh_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True End Sub Private Sub oWsh_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) Cancel = True End Sub
- 16 replies
-
- 5
-
- rangefrompoint
- mousehoover
-
(و1 أكثر)
موسوم بكلمه :