免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
來(lái)自【Excel完美論壇】
正在加載...

佛山小老鼠

昨天 22:06

樓主

【 Excel分享】快速錄入數(shù)據(jù)工具(附源代碼)



Private Declare Function GetDC Lib 'user32.dll' (ByVal hwnd As Long) As Long
Private Declare Function GetDeviceCaps Lib 'gdi32.dll' (ByVal HDC As Long, ByVal nIndex As Long) As Long
Private Declare Function ReleaseDC Lib 'user32.dll' (ByVal hwnd As Long, ByVal HDC As Long) As Long


Private Const LOGPIXELSX   As Long = 88
Private Function PointsPerPixel() As Double


    Dim HDC As Long
    Dim lngPotsPerInch As Long
    HDC = GetDC(0)
    lngPotsPerInch = GetDeviceCaps(HDC, LOGPIXELSX)
    PointsPerPixel = Application.InchesToPoints(1) / lngPotsPerInch
    ReleaseDC 0, HDC
End Function


Private Sub Worksheet_SelectionChange(ByVal T As Range)


    Dim rng As Range, x As Single, y As Single, DZoom As Single
    If T.Column = 2 And T.Count = 1 Then
  Set rng = ActiveCell
  With ActiveWindow
   DZoom = .Zoom / 100
   x = .PointsToScreenPixelsX((rng.Left + rng.Width) / PointsPerPixel * DZoom)
   y = .PointsToScreenPixelsY((rng.Top) / PointsPerPixel * DZoom)
  End With


  With 界面
   If .Visible = False Then .Show 0
   .Move x * PointsPerPixel, y * PointsPerPixel
  End With
  Set rng = Nothing
    Else
  Unload 界面
    End If
End Sub


Option Explicit


Private Sub CommandButton1_Click()
   Dim arr1, x, k, arr2(), kk, y
   On Error GoTo 100
   arr1 = Sheets('快捷錄入數(shù)據(jù)源').Range('A1').CurrentRegion
   For x = 1 To UBound(arr1)
  If VBA.InStr(1, arr1(x, 1), Me.TextBox1.Text) <> 0 Then
   k = k + 1
  End If
   Next x
   ReDim arr2(1 To k, 1 To UBound(arr1, 2))
   For x = 1 To UBound(arr1)
   If VBA.InStr(1, arr1(x, 1), Me.TextBox1.Text) <> 0 Then
   kk = kk + 1
   For y = 1 To UBound(arr1, 2)
    arr2(kk, y) = arr1(x, y)
   Next y
  End If
   Next x
   With Me.ListBox1
  .ColumnCount = UBound(arr1, 2)
  .List = arr2
  .ColumnWidths = '2厘米;1厘米;1厘米;1厘米'
    End With
    Exit Sub
100:
    MsgBox '搜索不到: ' & Me.TextBox1.Text
    Me.TextBox1 = ''
End Sub


Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim a, z
    a = Me.ListBox1.ListIndex
    For z = 1 To 4
  ActiveCell.Offset(0, z - 1) = Me.ListBox1.List(a, z - 1)
    Next z


End Sub


立即關(guān)注
11

全部回復(fù)

只看樓主 倒序排列

影風(fēng) LV2 2樓


感謝樓主的無(wú)私分享!

昨天 22:23

天天好心情 LV2 3樓

謝謝老鼠老師

昨天 22:23

蒲公英 LV2 4樓

好東西,趕緊收藏

昨天 22:24

塵封記憶 LV2 5樓

這個(gè)有用

昨天 22:24

正在加載...
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
完全手冊(cè)Excel VBA典型實(shí)例大全:通過(guò)368個(gè)例子掌握
Excel首字拼音模糊搜索及快捷錄入
Excel VBA 9.4 數(shù)組寫(xiě)入excel的方法和技巧
【20180309】- Excel VBA智能提示,實(shí)現(xiàn)快速輸入
一個(gè)excel文件,輸入不同的密碼就可以打開(kāi)不同的表格
用VBA代碼查詢(xún)兩列數(shù)據(jù)差異
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服