|
- Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
- Dim Rng As Range
- Set Rng = Selection
-
- Dim Sht As Worksheet
- Set Sht = Rng.Parent
- With Sht
- Rng = Selection
- If Rng.Column <= 8 Then
- Set Rng = .Cells(Rng.Row, "H")
- ElseIf Rng.Column = 9 Then
- Set Rng = .Cells(Rng.Row, "J")
- Else
- Set Rng = .Cells(Rng.Row, Rng.Column)
- End If
- Debug.Print Rng.Address
- Rng.Hyperlinks.Add Rng, Rng
-
-
- End With
- End Sub
- Sub llll()
- Dim Rng As Range
- Set Rng = Selection
- Debug.Print Rng.Address
-
- For ii = 1 To Rng.Rows.Count
- Debug.Print Rng(ii, 1)
- Select Case True
- Case Rng(ii, 1) Like "JPG*" ' "%JPG%"
- Debug.Print Rng(ii, 1).Address
- Stop
-
- Case Rng(ii, 1) Like "%Microsoft%"
- Stop
-
- End Select
- Next ii
- End Sub
- Sub llllll()
- Dim Arr, ii
-
- Arr = Array("JPG 文件", "JPG 文件", "", "MP4 文件", "MP4 文件", "MP4 文件", "FF", "Microsoft Office Excel 二进制工作表", "Microsoft Office Excel 启用了宏的工作表", "TMP 文件", "Microsoft Office ", "Microsoft Office Excel 97-2003 工作表")
-
- For ii = 0 To UBound(Arr)
-
- Select Case True
- Case Arr(ii) Like "JPG*"
- Debug.Print ii, Arr(ii),
- Debug.Print "JPG 文件"
- Case Arr(ii) Like "MP4*"
- Debug.Print ii, Arr(ii),
- Debug.Print "MP4 文件"
- Case Arr(ii) Like "Microsoft*"
- Debug.Print ii, Arr(ii),
- Debug.Print "Microsoft Office"
-
- End Select
- Next ii
- End Sub
- Sub ddd()
- Dim ShpRng As ShapeRange
- Set ShpRng = Application.ActiveWindow.Selection.ShapeRange
- Set ShpRng = Sheet3.Shapes("TextBox2")
- With ShpRng
- .Left = 400
- .Top = 300
- .Width = 200
- .Height = 150
- .TextFrame2.TextRange.Text = .Name & vbCr & .Left & vbCr & .Top & vbCr & .Width & vbCr & .Height
- End With
- Set ShpRng = Sheet3.Shapes("TextBox2")
- With ShpRng
- .Left = 400
- .Top = 300
- .Width = 20
- .Height = 10
- With .TextFrame
- .HorizontalAlignment = xlHAlignLeft
- .VerticalAlignment = xlVAlignBottom
- End With
-
- .TextFrame2.TextRange.Text = .Name
- End With
-
-
- End Sub
- ''
- Sub ddd1()
- Dim ShpRng As ShapeRange, ShpRng1 As ShapeRange
- Dim Shp As Shape, Shp1 As Shape
- 'Set ShpRng = Application.ActiveWindow.Selection.ShapeRange
- For Each Shp In Sheet3.Shapes
- Debug.Print Shp.Name
- Next Shp
-
- Set Shp = Sheet3.Shapes("TextBox 1")
- With Shp
- .Left = 400
- .Top = 300
- .Width = 200
- .Height = 150
- .TextFrame2.TextRange.Text = .Name & vbCr & .Left & vbCr & .Top & vbCr & .Width & vbCr & .Height
- .Fill.Visible = msoFalse
- With .Line
- .Weight = 1
- .ForeColor.RGB = RGB(0, 0, 0)
- End With
- End With
- Set Shp = Sheet3.Shapes("TextBox 2")
- With Shp
- .Left = 400
- .Width = 150
- .Height = 20
- .Top = 300 - .Height
- .Fill.Visible = msoFalse
- .Line.Visible = msoFalse
- With .TextFrame
- .HorizontalAlignment = xlHAlignLeft
- .VerticalAlignment = xlVAlignBottom
- End With
- .TextFrame2.TextRange.Text = .Name
- End With
-
-
- End Sub
复制代码
|
|