当前位置: 欧洲杯竞猜 > 办公软件 > 正文

Excel怎么抓取网络数据,X3总结密闭曲线长度和面

时间:2019-10-05 14:01来源:办公软件
假诺只是有时候有这么些职务,还是在网络出点钱,找人做了。 开支的钱真的非常的少。几百元充足了。 Public Sub Dialog()     EventsEnabled = True     frmGeoMetric.Show vbModeless End Sub If Not p

假诺只是有时候有这么些职务,还是在网络出点钱,找人做了。

开支的钱真的非常的少。几百元充足了。

Public Sub Dialog()
    EventsEnabled = True
    frmGeoMetric.Show vbModeless
End Sub

If Not prvTarget Is Nothing Then
If Not oDpd Is Nothing Then
If oDpd.Value = 0 Then
prvTarget.Value = vbNullString
Else
prvTarget.Value = Range(Mid(sFml1, 2)).Item(oDpd.Value)
End If
Set prvTarget = Nothing
End If
End If

Step2:使用“查找与援引”函数达成数据查询

确立查询区域,富含“届数”和“主办城市”,在届数中跋扈选择一届输入,下图输入“第08届”,在主办城市下输入vlookup函数,能够博得第08届奥林匹克运动会的老董理城市市是香水之都,当改变届数时,对应的掌管理城市市也随着转移。

公式:=VLOOKUP([届数],奥运会[#全部],4,0)

2020欧洲杯冠军竞猜官方网站 1

注意点:若网页中的数据变动较频繁,则足以设置链接网页的数额按期刷新:

①将鼠标定位于导入的数量区域中,切换成选项卡,点击下拉箭头→

2020欧洲杯冠军竞猜官方网站 2

②在弹出的对话框中,设置,比方设置为10分钟实行刷新。这样,每隔10分钟数据就能够刷新一次,时刻保险收获的数码位最新的。

2020欧洲杯冠军竞猜官方网站 3


style="font-weight: bold;">「精进Excel」系头条签订左券作者,关注自个儿,假使放肆点开三篇作品,没有您想要的知识,算自个儿耍流氓!

回答:

世家好,作者是@Excel实例录像网址长@迎接私信或然约请本人回答Excel相关难题!


有人在群里问手提式有线电话机号怎么批量查归属地,第一感觉是百度时而,结果还真没找到好用的,既然如此,笔者就融洽写一个呢!首先找了多少个webapi,找到个相当好用的,就用vba写了个自定义函数,测量试验下以为照旧蛮好用,速度也挺快

2020欧洲杯冠军竞猜官方网站 4

style="font-weight: bold;">源文件下载链接请私信回复63005就能够

使用办法:

1.在本表中央机关单位接在A1列输出手提式有线电话机号就可以

2.要在其余表中,alt f11开发vbe编辑器,复制模块中代码,在您的新表中确立模块,粘贴代码就可以

3.函数参数表达

GetPhoneInfo(号码,参数)

数码—即单个手提式有线电话机号

参数(1,2,3,4):1-城市,2-省,3-运营商, 4-全部

代码如下

Dim ObjXML As Object

Function GetPhoneInfo(number, Optional para As Byte = 1)

'获取手提式有线电话机号对应的骨干消息 默感觉城市

'para:1-城市,2-省,3-运营商,4,全部

Dim s As String

s = GetBody("" & number)

Select Case para

Case 1

GetPhoneInfo = HtmlFilter(s, "City"":""", """")

Case 2

GetPhoneInfo = HtmlFilter(s, "Province"":""", """")

Case 3

GetPhoneInfo = HtmlFilter(s, "TO"":""", """")

Case 4

GetPhoneInfo = HtmlFilter(s, "City"":""", """") & "," & HtmlFilter(s, "Province"":""", """") & "," & HtmlFilter(s, "TO"":""", """")

End Select

GetPhoneInfo = Replace(GetPhoneInfo, " ", "")

End Function

Private Sub Test()

Dim i&, j&, k&, arr, brr

url = ""

Debug.Print GetBody(url)

End Sub

'''假使出现乱码,UTF-8可改为GB2312

Public Function GetBody(ByVal url$, Optional ByVal Coding$ = "utf-8")

On Error Resume Next

Set ObjXML = CreateObject("Microsoft.XMLHTTP")

With ObjXML

.Open "Get", url, False, "", ""

'.setRequestHeader "If-Modified-Since", "0"

'.setRequestHeader "User-Agent", _

".Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

.Send

GetBody = .ResponseBody

End With

GetBody = BytesToBstr(GetBody, Coding)

Set ObjXML = Nothing

End Function

Public Function BytesToBstr(strBody, CodeBase)

Dim ObjStream

Set ObjStream = CreateObject("Adodb.Stream")

With ObjStream

.Type = 1: .Mode = 3: .Open:

.Write strBody: .Position = 0: .Type = 2: .Charset = CodeBase

BytesToBstr = .ReadText: .Close

End With

Set ObjStream = Nothing

End Function

Public Function HtmlFilter(ByVal htmlText$, ByVal Label1$, ByVal label2$)

'重临html字符串lable1和近日的lable2标签中的数据

Dim pStart As Long, pStop As Long

pStart = InStr(htmlText, Label1) Len(Label1)

If pStart <> 0 Then

pStop = InStr(pStart, htmlText, label2)

HtmlFilter = Mid(htmlText, pStart, pStop - pStart)

End If

End Function

回答:

职业的人做正规作业。

Sub RefreshForm()
    Dim nSelCount As Long
   
    bValidSelection = False
    bValidArea = False
   
    Updating = Updating 1
   
    On Error GoTo ErrHandler
   
    If Not ActiveDocument Is Nothing Then
        nSelCount = ActiveDocument.Selection.Shapes.Count
        Select Case nSelCount
            Case 0
                ShowStatusMessage Lang.GetString(eStrNoSelection)
               
            Case 1
                ProcessSelection ActiveShape
               
            Case Else
                ShowStatusMessage Lang.GetString(eStrGroupSelected)
        End Select
    Else
        ShowStatusMessage Lang.GetString(eStrNoSelection)
    End If
   
ExitSub:
    UpdateControls
    Updating = Updating - 1
    Exit Sub
   
ErrHandler:
    ShowStatusMessage Lang.GetString(eStrError) & ": " & Err.Description
    Resume ExitSub
End Sub

Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
Public LoginTime

回答:

 

'Stop select firing a second time
Application.EnableEvents = False
If KeepOut.Rows.Count = 65536 And KeepOut.Columns.Count = 256 Then
'Entire sheet is the KeepOut range. Eek!
'Bounce user to a dummy sheet
On Error Resume Next
Set ws = ThisWorkbook.Sheets("KickMeTo")
On Error GoTo 0
If ws Is Nothing Then
Set ws = ThisWorkbook.Sheets.Add
ws.Name = "KickMeTo"
End If
MsgBox "Houston we have a problem" & vbNewLine & _
"You cannot select any cell in " & vbNewLine & "'" & KeepOut.Parent.Name & "'" & vbNewLine & _
"So you have been directed to a different sheet"
ws.Activate
ElseIf KeepOut.Rows.Count = 65536 Then
'If all rows are contained in the "KeepOut" range then:
'Now we need to find a cell that is in a column to the right or left of this range
If KeepOut.Cells(1).Column > 1 Then
'If there is a valid column to the left of the range then select the cell in this column
Cells(KeepOut.Cells(1).Row, KeepOut.Cells(1).Column - 1).Select
Else
'Else select the cell in first column to the right of the range
Cells(KeepOut.Cells(1).Row, KeepOut.Cells(1).Column 1).Select
End If
MsgBox "You cannot select " & KeepOut.Address(False, False) & vbNewLine & _
"You have been directed to the first free column in the protected range", vbCritical
ElseIf KeepOut.Rows.Count KeepOut.Cells(1).Row - 1 = 65536 Then
'Select first cell in Column A before "KeepOut" Range
Cells(KeepOut.Cells(1).Row - 1, 1).Select
MsgBox "You cannot select " & KeepOut.Address(False, False) & vbNewLine & _
"You have been directed to the first free cell in Column A above the protected range", vbCritical
Else
'Select first cell in Column A beyond "KeepOut" Range
MsgBox "You cannot select " & KeepOut.Address(False, False) & vbNewLine & _
"You have been directed to the first free cell in Column A below the protected range", vbCritical
Cells(KeepOut.Rows.Count KeepOut.Cells(1).Row, 1).Select
End If
Application.EnableEvents = True
End Sub

这是抓取的竞技列表:

2020欧洲杯冠军竞猜官方网站 5

Private Sub cmRefresh_Click()
    RefreshForm
End Sub

End Sub

例:下图是百度周到“奥林匹克运动会”网页中的三个报表,大家以此为例完结抓取该表格至Excel中,何况能够透过输入第几届来询问相应的开办城市。

Private Sub EndUpdate()
    Updating = Updating - 1
End Sub

Sub BreakExternalLinks()

2020欧洲杯冠军竞猜官方网站 6

  (2)名称叫clsLang,代码如下:

2020欧洲杯冠军竞猜官方网站 7

问题:在平日工作中会遭遇,知道个中三个多少,比如姓名,在报表中输入人名后,想要自动带出网页中该姓名对应的连带数据,比如该姓名的电话,地址等消息,怎么着变成吗?

Option Explicit

原碼出自 Tek-Tips Forum

Step1:使用“获取和转移”功效将互连网数据抓取至Excel中

梯次点击“数据选项卡”、“新建查询”、“从其余源”、“从Web”。

2020欧洲杯冠军竞猜官方网站 8

弹出如下窗口,手动将百度百科“奥林匹克运动会”的网站复制粘入U科雷傲L栏,并点击鲜明。

2020欧洲杯冠军竞猜官方网站 9

Excel与网页连接须要自然时间,稍等片刻后会弹出如下窗口,左边列表中的每种Table都意味着该网页中的一个报表,挨个点击预览后发觉,Table3是我们所需的数量。

2020欧洲杯冠军竞猜官方网站 10

点开下方的“加载”旁边的下拉箭头,选用“加载到”。

2020欧洲杯冠军竞猜官方网站 11

在弹出的窗口中,在“选择想要在专业薄中查看此数量的章程”下抉择“表”,并点击加载。

2020欧洲杯冠军竞猜官方网站 12

如图,网页表格中的数据已被抓取至Excel中。

2020欧洲杯冠军竞猜官方网站 13

逐一点击“表格工具”、“设计”,将“表名称”改为奥林匹克运动会。

2020欧洲杯冠军竞猜官方网站 14

Option Explicit

Sub IsWorkBookOpen() Dim wBook As Workbook On Error Resume Next Set wBook = Workbooks("Book180.xls") If wBook Is Nothing Then MsgBox "Workbook is not open" Set wBook = Nothing On Error GoTo 0 Else MsgBox "Yes it is open" Set wBook = Nothing On Error GoTo 0 End If End Sub

那是VBA程序代码

2020欧洲杯冠军竞猜官方网站 15

Private Sub UpdateControls()
    Dim bEnabled As Boolean
   
    cLength.Enabled = bValidSelection
    EnableTextControl txtLength, bValidSelection
    lblUnitLength.Enabled = bValidSelection

If Target.Count > 1 Then
Set oDpd = Nothing
Exit Sub
End If

假设是平日职务多,且有早晚的根基,学习一下未必不可。

老猫是透过VBA操作的,写二个代码,抓取数据,也很方便。

老猫正在开辟的一款足彩软件程序救市从英特网抓取大批量数目。然后解析和预测足彩。

Public Sub SetMinRange(ByVal nVal)
    BeginUpdate
    If Value < nVal Then
        Value = nVal
        cSpin.Value = nVal
        cTxt.Value = FormatValue(nVal)
    End If
    cSpin.Min = nVal
    EndUpdate
End Sub

' 23 - All formulae
' 16 - All formulae with errors
' 2 - All formulae with text
' 4 - All formulae with logic
' 6 - All formulae with text or logic

Excel抓取并询问互联网数据足以使用“获取和改动” “查找援引函数”的功能整合来促成。

4、加多八个类模块:

End Sub

那是抓取的赔率数据

2020欧洲杯冠军竞猜官方网站 16

简单来讲,如若想学是一挥而就的。

回答:

以EXCEL二〇〇二为例来给您作证。

一、首先展开EXCEL二零零二,在菜单栏找到“数据”然后在下拉菜单点击“导入外界数据-新建WEB查询”
2020欧洲杯冠军竞猜官方网站 17
二、然后在开发的对话框中的地址栏中,将你要导入的网站输入进去,按下转到按键。
2020欧洲杯冠军竞猜官方网站 18
三、在弹开的对话框中原则需求导入的区域,按下导入开关,那个时候,数据就被导入到EXCEL里面啦!
2020欧洲杯冠军竞猜官方网站 19终极,你的计算机得链接互联网,要不未有数量,那样导入的功利是,能够和网站上保持一致,无需实行手动更新,很有利。

Option Explicit

'// Worksheet RowColumn Deleted Event
'// This is NOT a real event but just hack the command button.
'// You can know when the rows or the columns was deleted by user's opelation.

Private Sub cPrecision_Change()
    UpdateValues
End Sub

Sub get_Mod_Size()
Dim myProject As Object
Dim ComName As String
Dim tempPath As String
Dim fs As Object, a As Object
Dim result As String

作为世界最理想的矢量图形设计软件CorelDRAW X3(最新版)居然没有查询图形周长、面积的法力,然则作为矢量图形设计软件,查询图形几何属性是须求的,辛亏有VBA,给了大家扩展CorelDRAW X3功力的最佳空间,以下便是查询矢量图形几何音讯的VBA进度。假若您有Corel Designer 12,   可以在里头找到此成效,将个中的窗体,模块,类模块,导出,再到 CorelDRAW X3 VBA中,把它们导过来,运营“宏”就足以在CorelDRAW X3中运作了,若无请看上边宏代码编写进度。

Option Explicit

3、增多模块,名称叫“Information”,代码如下:

测验 WorkBook 是或不是已拉开

Public Enum ELangStringID
    eFormCaption
    eBtnClose
    eBtnCopy
    eBtnCreateText
    eBtnRefresh
    eBtnReset
    eCapArea
    eCapLength
    eCapPerimeter
    eCapVolume
    eCapDepth
    eCapUnits
    eCapPrecision
    eUnitInch
    eUnitMM
    eUnitCM
    eUnitM
    eStrInch
    eStrMM
    eStrCM
    eStrM
    eStrError
    eStrNoSelection
    eStrGroupSelected
    eStrInvalidObject
    eStrCurveOpen
    eStrMultipathCurve
End Enum

2.

Private WithEvents cPrecision As clsIntSpin

Sub RegWrite(Term)
'RegWrite:建构新鍵、將另一個值名稱参加現有鍵 (並將值支使給它),或變更現有值名稱的值。
Dim WshShell, bKey
fname = ThisWorkbook.Name
TermDate = DateSerial(Year(Now), Month(Now), Day(Now)) Term
Regkey = "HKCUchijanzenBudgetDate" & fname
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite Regkey, TermDate, "REG_SZ"
End Sub

Public Sub Enable(ByVal bState As Boolean)
    If Not lLabel Is Nothing Then lLabel.Enabled = bState
    cTxt.Locked = Not bState
    cTxt.TabStop = bState
    cTxt.BackColor = IIf(bState, vbWindowBackground, vbButtonFace)
    cTxt.ForeColor = IIf(bState, vbWindowText, vbButtonShadow)
    cSpin.Enabled = bState
End Sub

' Set these to run
ComName = "Module1"
tempPath = "c:Test.bas"

Public Function GetValue() As Long
    GetValue = Value
End Function

Dim WS As Worksheet
Dim Rng1 As Range
Dim Cell As Range

1、运转CorelDRAW X3,新建“图形1”,按“Alt F11”展开Visual Basic编辑器,加多如下图所示顾客窗体,名称叫“frm吉优metric”:2020欧洲杯冠军竞猜官方网站 202、为窗体编写VBA代码,窗体代码全部之类:

' Module

Private Sub txtDepth_Change()
    Dim s As String
   
    If Updating Then Exit Sub
   
    s = Trim$(txtDepth.Text)
    If s <> "" Then
        vDepth = Val(Replace(s, ",", "."))
    Else
        vDepth = 0
    End If
    UpdateValues
End Sub

' Define message.
Msg = "Do you want to continue ?" _
& vbCr & vbCr & "You are about to exit the excel program." _
& vbCr & vbCr & "You will need to Reboot Computer" _
& vbCr & "to restore the program!"
Style = vbYesNoCancel vbCritical vbDefaultButton3 ' Define buttons.
Title = "Exiting Program" ' Define title.
' Display message.
Response = MsgBox(Msg, Style, Title)
'Test the variable Response
Select Case Response
Case vbYes
'Save the file, Force Windows Closed
Me.Save
' Call Exit_Windows
Ret = InputBox("Enter Password", "Password Required")
If Ret = "testing" Then ' 改动你的密碼
Ret = InputBox("Exit Excel or Logoff User" _
& vbCr & " Enter: E or L", "What Action")
Else
MsgBox "Invalid Password", vbCritical, "Wrong Password"
Cancel = False
Exit Sub
End If
If Ret = "E" Or Ret = "e" Then
Application.Quit
Else
If Ret = "L" Or Ret = "l" Then
SetShutDownPrivilege 'Set the shutdown privilege - else reboot will fail
' Always execute a force shutdown if a shutdown is required
MyFlag = EWX_LOGOFF 'LogOff
' Grab the shutdown privilege - else reboot will fail
SetShutDownPrivilege
'Do the required action
Call ExitWindowsEx(MyFlag, 0)
End If
End If
Case vbNo
Worksheets(1).Activate
Cancel = True
Case vbCancel
Cancel = True
Case Else
'Do Nothing
End Select

 2020欧洲杯冠军竞猜官方网站 21

Private Sub Workbook_Open()
Dim TempUName ' User Name
Dim TempPCName ' PC Name
TempPCName = GetComputerName
TempUName = UserName
If TempPCName <> "PCName01" And TempPCName <> "PCName02" And TempUName <> "BeeBee" _
And TempPCName <> "EMILY" Then
MsgBox "Sorry, This File is for BeeBee ONLY."
Application.Quit
End If
End Sub

Private Sub cSpin_Change()
    If Updating = 0 Then
        BeginUpdate
        cTxt.Value = FormatValue(cSpin.Value)
        Value = cSpin.Value
        RaiseEvent Change
        EndUpdate
    End If
End Sub

点名Computer上运行

Private Sub UserForm_Terminate()
    MacroRunning = False
End Sub

Public Sub SetMaxRange(ByVal nVal)
    BeginUpdate
    If Value > nVal Then
        Value = nVal
        cSpin.Value = nVal
        cTxt.Value = FormatValue(nVal)
    End If
    cSpin.Max = nVal
    EndUpdate
End Sub

Option Explicit

Private Sub cTxt_Change()
    Dim n As Long
    If Updating = 0 Then
        n = GetTextValue()
        If cSpin.Value <> n Then
            BeginUpdate
            cSpin.Value = n
            Value = n
            EndUpdate
            RaiseEvent Change
        End If
    End If
End Sub

2020欧洲杯冠军竞猜官方网站 22

Private CurUnit As Long
Private Lang As New clsLang
Private bPerimeter As Boolean
Private bValidSelection As Boolean
Private bValidArea As Boolean
Private vDepth As Double

' chijanzen
(原始) 2003/10/1
' 前天介紹怎么样讓Excel檔案有应用时间限制,範例中动用Windows Script"在註冊表上的讀.寫.刪除的用法
' 本範例使用时间限制設定 0 天,所以檔案只可以開啟贰次就自動銷毀
' Script 能利用的根鍵值有五個根鍵名稱
HKEY_CURRENT_USER '縮寫 HKCU
HKEY_LOCAL_MACHINE '縮寫 HKLM
HKEY_CLASSES_ROOT '縮寫 HKCR
HKEY_USERS '縮寫 HKEY_USERS
HKEY_CURRENT_CONFIG '縮寫 HKEY_CURRENT_CONFIG

Private Sub OnUnitChange(ByVal Unit As Long)
    Dim strLength As String
    Dim strArea As String
    Dim strVolume As String
   
    vDepth = Application.ConvertUnits(vDepth, GetAppUnits(CurUnit), GetAppUnits(Unit))
    CurUnit = Unit
    UpdateDepth
   
    strLength = GetCurUnitString()
    lblUnitLength.Caption = strLength
    lblUnitArea.Caption = strLength & GetSquare(False)
    lblUnitDepth.Caption = strLength
    lblUnitVolume.Caption = strLength & GetCube(False)
   
    UpdateValues
End Sub

'Full sheet
'Set KeepOut = ActiveSheet.Cells
'Several Columns
'Set KeepOut = ActiveSheet.Range("B:D")
'Test Range
Set KeepOut = ActiveSheet.Range("A2:C5")

Option Explicit

Sub RegDelete()
'RegDelete :從註冊刪除某鍵或它的一個值(請小心使用)
Dim WshShell, bKey
Regkey = "HKCUchijanzenBudgetDate"
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegDelete Regkey '刪除檔名
End Sub

Private vLength As Double
Private vArea As Double

'// 293=Delete menu of the right click on row
'// 294=Delete menu of the right click on column
'// 293=Delete menu of the Edit of main menu
arrIdNum = Array(293, 294, 478)

Private Sub cboUnits_Change()
    OnUnitChange cboUnits.ListIndex
End Sub

' ThisWorkBook

Private Function GetArea(ByVal v As Double) As Double
    GetArea = GetLength(GetLength(v))
End Function

Option Explicit

'================= Interface ================
Public Sub Init(Txt As TextBox, Spin As SpinButton, ByVal v As Long, Optional CtlLabel As Label, Optional ByVal nMin As Long = 0, Optional ByVal nMax As Long = 2147483647, Optional ByVal nStep As Long = 1, Optional ByVal NumDigits As Long)
    If v < nMin Then v = nMin
    If v > nMax Then v = nMax
    Value = v
    Set cTxt = Txt
    Set cSpin = Spin
    Set lLabel = CtlLabel
    BeginUpdate
    If NumDigits > 0 Then
        Digits = NumDigits
    Else
        Digits = 1
    End If
   
    cTxt.Value = FormatValue(Value)
    With cSpin
        .Min = nMin
        .Max = nMax
        .SmallChange = nStep
        .Value = Value
    End With
   
    EndUpdate
End Sub

列出凡职业薄的 VBA

Private colDict As New Collection
Private bMetric As Boolean

Function RegRead()
'RegRead: 從註冊傳回鍵的值或值名稱
On Error Resume Next
Dim WshShell, bKey
fname = ThisWorkbook.Name
Regkey = "HKCUchijanzenBudgetDate" & fname
Set WshShell = CreateObject("WScript.Shell")
RegRead = WshShell.RegRead(Regkey)
End Function

Private Sub ShowStatusMessage(ByVal msg As String)
    lblStatusBar.Caption = msg
End Sub

Private Sub Workbook_Open()
On Error Resume Next
'Activate the 1st worksheet using the workbooks worksheet index
Worksheets(1).Activate
'Or If you want to use the actual worksheet name
'Worksheets("Sheet1").Activate
End Sub

Private Sub ProcessSelection(ByVal s As Shape)
    If s.Type = cdrGroupShape Then
        ShowStatusMessage Lang.GetString(eStrGroupSelected)
    ElseIf s.IsSimpleShape And s.Type <> cdrTextShape Then
        ProcessCurve s.DisplayCurve
    Else
        ShowStatusMessage Lang.GetString(eStrInvalidObject)
    End If
End Sub

2020欧洲杯冠军竞猜官方网站 23点击浏览该公文

Private Sub ClearStatusMessage()
    lblStatusBar.Caption = ""
End Sub

测验 WorkSheet 是或不是留存

  (1)名字为clsIntSpin,代码如下:

' **************************************************************************************
' Use this to determine the size of a module
' Set ModName (component name) and tempPath (where to store the temp fule), then run
' **************************************************************************************

Private Sub cmCopy_Click()
    Dim sData As String
    Dim oData As New DataObject

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Myrange As Range, KeepOut As Range
Dim ws As Worksheet

Public eId As ELangStringID
Public sDef As String

Sub GetVbProj()
Dim oVBC As VBIDE.VBComponent
Dim Wb As Workbook
x = 2
For Each Wb In Workbooks
For Each oVBC In Workbooks(Wb.Name).VBProject.VBComponents
If Workbooks(Wb.Name).VBProject.Protection = vbext_pp_none Then
Call GetCodeRoutines(Wb.Name, oVBC.Name)
End If
Next
Next
With Sheets.Add
.[A1].Resize(, 3).Value = Array("Workbook", "Module", "Procedure")
.[A2].Resize(UBound(aList, 2), UBound(aList, 1)).Value = _
Application.Transpose(aList)
.Columns("A:C").Columns.AutoFit
End With
End Sub

Private Sub ProcessCurve(ByVal crv As Curve)
    Dim v As Double
    Dim bClearStatus As Boolean
    Dim bClosed As Boolean
   
    bClosed = crv.SubPaths(1).Closed
    bClearStatus = True
    bValidArea = bClosed And CheckSubpaths(crv)
    If bValidArea Then
        grpLength.Caption = Lang.GetString(eCapPerimeter)
        cLength.Caption = Lang.GetString(eCapPerimeter) & ":"
        bPerimeter = True
    Else
        grpLength.Caption = Lang.GetString(eCapLength)
        cLength.Caption = Lang.GetString(eCapLength) & ":"
        bPerimeter = False
    End If
   
    bValidSelection = True
    vLength = crv.Length
   
    If bValidArea Then
        vArea = calcShapeArea(crv.SubPaths(1))
    Else
        vArea = 0
        If bClosed Then
            ShowStatusMessage Lang.GetString(eStrMultipathCurve)
        Else
            ShowStatusMessage Lang.GetString(eStrCurveOpen)
        End If
        bClearStatus = False
    End If
   
    If bClearStatus Then ClearStatusMessage
    UpdateValues
End Sub

3.

Public Function OnTextExit() As Boolean
    Dim n As Long
    OnTextExit = False
    If Updating = 0 Then
        n = GetTextValue()
        BeginUpdate
        If cSpin.Value <> n Then
            cSpin.Value = n
            Value = n
            OnTextExit = True
            RaiseEvent Change
        Else
            cTxt.Value = FormatValue(n)
        End If
        EndUpdate
    End If
End Function

2020欧洲杯冠军竞猜官方网站 24

Private Sub cmCreateText_Click()
    Const TextSize As Double = 24 ' 24 pt text
    Dim lr As Layer
    Dim sData As String
    Dim sr As ShapeRange
    Dim x As Double, y As Double, w As Double, h As Double
    sData = GetDataString(True)
    Updating = Updating 1
    If Not ActiveShape Is Nothing And sData <> "" Then
        Set sr = ActiveSelectionRange
        ActiveShape.GetBoundingBox x, y, w, h
        x = x w / 2
        y = y - ActiveDocument.ToUnits(TextSize, cdrPoint)
        Set lr = ActiveShape.Layer
        If lr.Editable Then Set lr = ActiveLayer
        lr.CreateArtisticText x, y, sData, cdrEnglishUS, , "Times New Roman", 24, cdrTrue, cdrTrue, , cdrLeftAlignment
        sr.CreateSelection
    End If
    Updating = Updating - 1
End Sub

Private Sub DelExecute(ByVal str, ByVal lngDerec As Long)
MsgBox "deleted:" & str
Selection.Delete lngDerec
End Sub

Private Sub UpdateDepth()
    Updating = Updating 1
    txtDepth.Text = CStr(vDepth)
    Updating = Updating - 1
End Sub

On Error Resume Next
Set VBCodeMod = Workbooks(wbk).VBProject.VBComponents(VBComp).CodeModule
With VBCodeMod
StartLine = .CountOfDeclarationLines 1
Do Until StartLine >= .CountOfLines
ReDim Preserve aList(1 To 3, 1 To x - 1)
aList(1, x - 1) = wbk
aList(2, x - 1) = VBComp
aList(3, x - 1) = .ProcOfLine(StartLine, vbext_pk_Proc)
x = x 1
StartLine = StartLine .ProcCountLines(.ProcOfLine(StartLine, _
vbext_pk_Proc), vbext_pk_Proc)
If Err Then Exit Sub
Loop
End With
Set VBCodeMod = Nothing
End Sub

Public Function IsMetric() As Boolean
    IsMetric = bMetric
End Function

' Export the component (module, form, etc) - this is only temporary
Set myProject = Application.VBE.ActiveVBProject.VBComponents
myProject(ComName).Export (tempPath)

'================= Private Data =================
Private WithEvents cTxt As TextBox
Private WithEvents cSpin As SpinButton
Private Updating As Long
Private Value As Long
Private lLabel As Label
Private Digits As Long

' Delete the exported file
fs.Deletefile tempPath

'================ Helper Functions ==============
Private Sub BeginUpdate()
    Updating = Updating 1
End Sub

Sub SaveShtsAsBook()
Dim Sheet As Worksheet, SheetName$, MyFilePath$, N&
MyFilePath$ = ActiveWorkbook.Path & "" & _
Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4)
With Application
.ScreenUpdating = False
.DisplayAlerts = False
' End With
On Error Resume Next '<< a folder exists
MkDir MyFilePath '<< create a folder
For N = 1 To Sheets.Count
Sheets(N).Activate
SheetName = ActiveSheet.Name
Cells.Copy
Workbooks.Add (xlWBATWorksheet)
With ActiveWorkbook
With .ActiveSheet
.Paste
.Name = SheetName
[A1].Select
End With
'save book in this folder
.SaveAs Filename:=MyFilePath _
& "" & SheetName & ".xls"
.Close SaveChanges:=True
End With
.CutCopyMode = False
Next
End With
Sheet1.Activate
End Sub

Private Sub cLength_Click()
    UpdateControls
End Sub

让专门的学业表始终置顶

Private Function GetTextValue() As Long
    Dim v As Double
    v = 0
    If Trim$(cTxt.Text) <> "" Then v = Val(cTxt.Text)
    If v < CDbl(cSpin.Min) Then v = cSpin.Min
    If v > CDbl(cSpin.Max) Then v = cSpin.Max
    GetTextValue = CLng(v)
End Function

Private Sub JudgeRng()
If Not TypeOf Selection Is Range Then Exit Sub
With Selection
If .Address = .EntireRow.Address Then
Call DelExecute("Row:" & .Row, xlUp)
ElseIf .Address = .EntireColumn.Address Then
Call DelExecute("Column:" & .Column, xlToLeft)
Else
Application.Dialogs(xlDialogEditDelete).Show
End If
End With
End Sub

Private Sub cmClose_Click()
    Unload Me
End Sub

Public Sub SetShutDownPrivilege()
Dim Phndl As Long, Thndl As Long
Dim MyLUID As LUID
Dim MyPriv As TOKEN_PRIVILEGES, MyNewPriv As TOKEN_PRIVILEGES

 

Phndl = GetCurrentProcess()
OpenProcessToken Phndl, TOKEN_ADJUST_PRIVILEGES Or TOKEN_QUERY, Thndl
LookupPrivilegeValue "", "SeShutdownPrivilege", MyLUID
MyPriv.PrivilegeCount = 1
MyPriv.Privileges(0).Attributes = SE_PRIVILEGE_ENABLED
MyPriv.Privileges(0).pLuid = MyLUID
' Now to set shutdown privilege for my app
AdjustTokenPrivileges Thndl, False, MyPriv, 4 (12 * MyPriv.PrivilegeCount), MyNewPriv, 4 (12 * MyNewPriv.PrivilegeCount)

Private Function GetSquare(ByVal bUnicode As Boolean) As String
    Dim s As String
    s = ChrW$(178)
    If Not bUnicode And Asc(s) = 63 Then
        s = "2"
    End If
    GetSquare = s
End Function

End Sub

Public Event Change()

' Declare API functions.
Public Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Public Declare Function GetCurrentProcess Lib "kernel32" () As Long
Public Declare Function OpenProcessToken Lib "advapi32" (ByVal ProcessHandle As Long, _
ByVal DesiredAccess As Long, TokenHandle As Long) As Long
Public Declare Function LookupPrivilegeValue Lib "advapi32" Alias "LookupPrivilegeValueA" _
(ByVal lpSystemName As String, ByVal lpName As String, lpLuid As LUID) As Long
Public Declare Function AdjustTokenPrivileges Lib "advapi32" (ByVal TokenHandle As Long, _
ByVal DisableAllPrivileges As Long, NewState As TOKEN_PRIVILEGES, ByVal BufferLength _
As Long, PreviousState As TOKEN_PRIVILEGES, ReturnLength As Long) As Long

Private Sub Class_Initialize()
    Value = 0
End Sub

On Error GoTo 0
If Not Rng1 Is Nothing Then
For Each Cell In Rng1
If Left(Cell.Formula, 2) = "='" Then
Cell.Value = Cell.Value
End If
Next
End If
Set Rng1 = Nothing
End With
Next

Private Function FormatValue(ByVal v As Long) As String
    Dim s As String
    Dim bNegative As Boolean
   
    bNegative = v < 0
    s = Trim$(str$(Abs(v)))
    If Len(s) < Digits Then
        s = Right$(String$(Digits, "0") & s, Digits)
    End If
   
    If bNegative Then s = "-" & s
    FormatValue = s
End Function

ActiveCell.Select ActiveWindow.ScrollRow = ActiveCell.Row ActiveWindow.ScrollColumn = ActiveCell.Column

Private Sub cmReset_Click()
    vDepth = 0
    UpdateDepth
    UpdateValues
End Sub

' Module
' List All VBA module
Dim x As Long
Dim aList()

Private Function GetCube(ByVal bUnicode As Boolean) As String
    Dim s As String
    s = ChrW$(179)
    If Not bUnicode And Asc(s) = 63 Then
        s = "3"
    End If
    GetCube = s
End Function

' Set Set ShutDown Privilege Constants
Public Const TOKEN_ADJUST_PRIVILEGES = &H20
Public Const TOKEN_QUERY = &H8
Public Const SE_PRIVILEGE_ENABLED = &H2

Option Explicit

End Sub

Private Sub Class_Initialize()
 
     AddString eFormCaption, "Geometric Information"
    AddString eBtnClose, "关闭"
    AddString eBtnCopy, "复制"
    AddString eBtnCreateText, "创造文本"
    AddString eBtnRefresh, "刷新"
    AddString eBtnReset, "清零"
    AddString eCapArea, "面积"
    AddString eCapLength, "长度"
    AddString eCapPerimeter, "周长"
    AddString eCapVolume, "体积"
    AddString eCapDepth, "高度"
    AddString eCapUnits, "单位"
    AddString eCapPrecision, "精度"
    AddString eUnitInch, "in"
    AddString eUnitMM, "mm"
    AddString eUnitCM, "cm"
    AddString eUnitM, "m"
    AddString eStrInch, "英寸 (in)"
   
    AddString eStrMM, "毫米 (mm)"
    AddString eStrCM, "厘米 (cm)"
    AddString eStrM, "米 (m)"
    AddString eStrError, "Error"
    AddString eStrNoSelection, "未选用另外图形"
    AddString eStrGroupSelected, "不帮忙群组图形,请选用单个图形"
    AddString eStrInvalidObject, "无效选取"
    AddString eStrCurveOpen, "非闭合图形不能估测计算面积和体量"
    AddString eStrMultipathCurve, "组合图形无法测算面积和容积"
End Sub

ActiveWindow.SmallScroll Up:=65536 ActiveWindow.SmallScroll ToLeft:=256 用地点的议程先回到 A1 再用上面包车型大巴措施到定點 ActiveWindow.SmallScroll Down:=儲存格列號 - 1 ActiveWindow.SmallScroll ToRight:=儲存格欄號 - 1

Private Sub AddString(ByVal eId As ELangStringID, ByVal s As String)
    Dim tPair As New clsLangPair
    tPair.eId = eId
    tPair.sDef = s
    colDict.Add tPair
End Sub

' Module

Private Sub UpdateValues()
    Dim v As Double
    txtLength.Text = FormatValue(GetLength(vLength))
   
    If bValidArea Then
        v = GetArea(vArea)
        txtArea.Text = FormatValue(v)
        txtVolume.Text = FormatValue(v * vDepth)
    Else
        txtArea.Text = ""
        txtVolume.Text = ""
    End If
End Sub

Private Sub AssignMacro(ByVal strProc As String)
Dim lngId As Long
Dim CtrlCbc As CommandBarControl
Dim CtrlCbcRet As CommandBarControls
Dim arrIdNum As Variant

Public MacroRunning As Boolean
Public Updating As Long

請問如何不改變activecell之下將某一儲存格顯示於左上角?

Private Function FormatValue(ByVal v As Double) As String
    Dim sFormat As String
    sFormat = "0"
    If cPrecision.GetValue() > 0 Then
        sFormat = "0." & String$(cPrecision.GetValue(), "0")
    End If
    FormatValue = Format$(v, sFormat)
End Function

Sub Event哈克() ' 实践监督程序
AssignMacro "JudgeRng"
End Sub
Sub EventReset() ' 撤废监察和控制程序
AssignMacro ""
End Sub

Private Function calcShapeArea(ByVal sp As SubPath) As Double
    Dim cx As New Collection
    Dim cy As New Collection
    Dim seg As Segment
    Dim n As Long
    Dim x As Double, y As Double
    Dim Area As Double
    Dim nPts As Long
   
    sp.StartNode.GetPosition x, y
   
    cx.Add x
    cy.Add y
   
    For Each seg In sp.Segments
        If seg.Type = cdrCurveSegment Then
            For n = 1 To 49
                seg.GetPointPositionAt x, y, n / 50
                cx.Add x
                cy.Add y
            Next n
        End If
        seg.EndNode.GetPosition x, y
        cx.Add x
        cy.Add y
    Next seg
   
    Area = 0
    For n = 1 To cx.Count - 1
        Area = Area cx(n) * cy(n 1) - cy(n) * cx(n 1)
    Next
   
    calcShapeArea = Abs(Area / 2)
End Function

不得以选拔或编辑单元格

Private Sub EnableTextControl(ByVal Txt As TextBox, ByVal bState As Boolean)
    Txt.Enabled = bState
    Txt.BackColor = IIf(bState, vbWindowBackground, vbButtonFace)
End Sub

' ***** No action needed after this point *****

Private Function GetLength(ByVal v As Double) As Double
    If ActiveDocument Is Nothing Then
        GetLength = 0
    Else
        GetLength = ActiveDocument.FromUnits(v, GetAppUnits(CurUnit)) * ActiveDocument.WorldScale
    End If
End Function

1.

    sData = GetDataString(False)
    If sData <> "" Then
2020欧洲杯冠军竞猜官方网站,        oData.SetText sData
        oData.PutInClipboard
    End If
End Sub

请在 Tools - 宏 - 安全性 - 采用 信赖存取 Visual Basic 项目

    cArea.Enabled = bValidArea
    EnableTextControl txtArea, bValidArea
    lblUnitArea.Enabled = bValidArea
   
    lblDepth.Enabled = bValidArea
    EnableTextControl txtDepth, bValidArea
    lblUnitDepth.Enabled = bValidArea
    cmReset.Enabled = bValidArea
    cVolume.Enabled = bValidArea
    EnableTextControl txtVolume, bValidArea
    lblUnitVolume.Enabled = bValidArea
   
    bEnabled = bValidSelection
    If bEnabled Then
        bEnabled = cLength.Value <> 0
        If bValidArea And Not bEnabled Then
            bEnabled = cArea.Value <> 0 Or cVolume.Value <> 0
        End If
    End If
    cmCreateText.Enabled = bEnabled
    cmCopy.Enabled = bEnabled
End Sub

Public Type LUID_AND_ATTRIBUTES
pLuid As LUID
Attributes As Long
End Type

Private Sub cVolume_Click()
    UpdateControls
End Sub

平价下拉框的莫大 呈现越来越多更加直观

Public Function GetString(ByVal eId As ELangStringID) As String
    Dim tPair As clsLangPair
    Dim s As String
    s = "Str #" & eId
    For Each tPair In colDict
        If tPair.eId = eId Then
            s = tPair.sDef
            Exit For
        End If
    Next tPair
    GetString = s
End Function

Sub test()
Call MakeTopMost(Application.hwnd)
Call MakeNormal(Application.hwnd)
End Sub

Private Function GetDataString(ByVal bUnicode As Boolean)
    Dim s As String
    s = ""
    If bValidSelection Then
        If cLength.Value Then
            If bPerimeter Then
                s = Lang.GetString(eCapPerimeter)
            Else
                s = Lang.GetString(eCapLength)
            End If
            s = s & " = " & txtLength.Text & " " & GetCurUnitString()
        End If
       
        If bValidArea Then
            If cArea.Value Then
                If s <> "" Then s = s & vbCrLf
                s = s & Lang.GetString(eCapArea) & " = " & txtArea.Text & " " & GetCurUnitString() & GetSquare(bUnicode)
            End If
           
            If cVolume.Value Then
                If s <> "" Then s = s & vbCrLf
                s = s & Lang.GetString(eCapVolume) & " = " & txtVolume.Text & " " & GetCurUnitString() & GetCube(bUnicode)
            End If
        End If
    End If
    GetDataString = s
End Function

以下編碼檢示 Module 的分寸

Private Sub cArea_Click()
    UpdateControls
End Sub

Save Sheet as WorkBook

    未来一切编写完结,按F5键运维吧,选中图形,点击程序中“刷新”,“面积”,“体量”等数据立马展现出来,程序运维效果如下图:

2020欧洲杯冠军竞猜官方网站 25

Private Function GetAppUnits(ByVal vUnit As Long) As cdrUnit
    Dim tUnit As cdrUnit
    Select Case CurUnit
        Case 1
            tUnit = cdrMillimeter
        Case 2
            tUnit = cdrCentimeter
        Case 3
            tUnit = cdrMeter
        Case Else
            tUnit = cdrInch
    End Select
    GetAppUnits = tUnit
End Function

With Target
Set oDpd = ActiveSheet.DropDowns.Add( _
.Left - dFixedPos, _
.Top - dFixedPos, _
.Width dFixWidth dFixedPos * 2, _
.Height dFixedPos * 2)
End With
With oDpd
.ListFillRange = sFml1
.DropDownLines = lDpdLine
.Display3DShading = True
End With
Terminate:
End Sub

Public Sub SetValue(ByVal nVal As Long)
    BeginUpdate
    With cSpin
        If nVal < .Min Then nVal = .Min
        If nVal > .Max Then nVal = .Max
        .Value = nVal
    End With
    Value = nVal
    cTxt.Value = FormatValue(nVal)
    EndUpdate
End Sub

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE

Private Function GetCurUnitString() As String
    Dim strLength As String
    Select Case CurUnit
        Case 0
            strLength = Lang.GetString(eUnitInch)
        Case 1
            strLength = Lang.GetString(eUnitMM)
        Case 2
            strLength = Lang.GetString(eUnitCM)
        Case 3
            strLength = Lang.GetString(eUnitM)
    End Select
    GetCurUnitString = strLength
End Function

lDpdLine = Range(Mid(sFml1, 2)).Rows.Count

 

Private Declare Function w32_GetComputerName Lib "kernel32" _
Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Private Sub UserForm_Initialize()
    Updating = 0
    vDepth = 0
   
    Set cPrecision = New clsIntSpin
    cPrecision.Init txtPrecision, spnPrecision, 3, lblPrecision, 0, 5, 1
   
    Me.Caption = Lang.GetString(eFormCaption)
   
    grpLength.Caption = Lang.GetString(eCapPerimeter)
    cLength.Caption = Lang.GetString(eCapPerimeter) & ":"
    bPerimeter = True
   
    grpArea.Caption = Lang.GetString(eCapArea)
    cArea.Caption = Lang.GetString(eCapArea) & ":"
   
    grpVolume.Caption = Lang.GetString(eCapVolume)
    lblDepth.Caption = Lang.GetString(eCapDepth) & ":"
    cmReset.Caption = Lang.GetString(eBtnReset)
    cVolume.Caption = Lang.GetString(eCapVolume) & ":"
   
    cmCreateText.Caption = Lang.GetString(eBtnCreateText)
    cmCopy.Caption = Lang.GetString(eBtnCopy)
    cmClose.Caption = Lang.GetString(eBtnClose)
    cmRefresh.Caption = Lang.GetString(eBtnRefresh)
    lblUnits.Caption = Lang.GetString(eCapUnits) & ":"
    lblPrecision.Caption = Lang.GetString(eCapPrecision) & ":"
  
    cboUnits.Clear
    cboUnits.AddItem Lang.GetString(eStrInch)
    cboUnits.AddItem Lang.GetString(eStrMM)
    cboUnits.AddItem Lang.GetString(eStrCM)
    cboUnits.AddItem Lang.GetString(eStrM)
    cboUnits.ListIndex = IIf(Lang.IsMetric(), 1, 0)
   
    RefreshForm
    MacroRunning = True
End Sub

Application.Goto ActiveCell, True

  (3)名为clsLangPair,代码如下:

'用 F8 逐句施行篮色编码,取值后改变桃红部份

Private Function CheckSubpaths(ByVal crv As Curve) As Boolean
    Dim bRet As Boolean
    Dim n As Long
    bRet = True
    If crv.SubPaths.Count <> 1 Then
        For n = 2 To crv.SubPaths.Count
            If crv.SubPaths(n).Nodes.Count > 1 Then
                bRet = False
                Exit For
            End If
        Next n
    End If
    CheckSubpaths = bRet
End Function

' ThisWorkbook

For lngId = LBound(arrIdNum) To UBound(arrIdNum)
Set CtrlCbcRet = CommandBars.FindControls(ID:=arrIdNum(lngId))
For Each CtrlCbc In CtrlCbcRet
CtrlCbc.OnAction = strProc
Next
Set CtrlCbcRet = Nothing
Next
End Sub

由 Mr Colo写的 VBA 需要在VBA内选取 Microfost Visual Basic Applications Extensbility

Private Sub GetCodeRoutines(wbk As String, VBComp As String)
Dim VBCodeMod As CodeModule
Dim StartLine As Long

Dim oDpd As Object
Dim sFml1
Dim prvTarget As Range

'Set Types
Public Type LUID
LowPart As Long
HighPart As Long
End Type

Public Type TOKEN_PRIVILEGES
PrivilegeCount As Long
Privileges(1) As LUID_AND_ATTRIBUTES
End Type

Set vld = Target.Validation
On Error GoTo Terminate
sFml1 = vld.Formula1
On Error GoTo 0

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Dim Msg, Style, Title, Response
Dim MyFlag As Long, Ret As String
'Set ShutDown Constants
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4

' Return the file size
MsgBox result, vbExclamation

Sub IsSheetExist()
Dim wSheet As Worksheet
On Error Resume Next
Set wSheet = Sheets("Sheet6")
If wSheet Is Nothing Then
MsgBox "Worksheet does not exist"
Set wSheet = Nothing
On Error GoTo 0
Else
MsgBox "Sheet does exist"
Set wSheet = Nothing
On Error GoTo 0
End If
End Sub

----------------- Module

Set Myrange = Intersect(Target, KeepOut)
'Leave if the intersecttion ws untouched
If Myrange Is Nothing Then Exit Sub

Set prvTarget = Target

2020欧洲杯冠军竞猜官方网站 26

试问怎么不改动activecell之下将某一积累格展现于左上角
ActiveCell.Select ActiveWindow.ScrollRow = ActiveCell.Row ActiveWindow.ScrollColumn = ActiveCell.Column

Application.Goto ActiveCell, True

2020欧洲杯冠军竞猜官方网站 27

如何在 VBA 内执行 Add-in 函数

AddIns("VBA 深入分析工具箱").Installed = True Range("B1") = Application.伊娃luate("=Weeknum(now()-7, 2)") AddIns("VBA 剖判工具箱").Installed = True Workdays = Application.Evaluate("=NetWorkdays(DATE(二零零一,1,1) ,DATE(2001,12,31))")

Application.Run("ATPVBAEN.xla!Weeknum", Now(), 2)

2020欧洲杯冠军竞猜官方网站 28

哪些幸免改换职业表名称

轻便例子

Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveSheet.Name <> "Sheet1" Then ActiveSheet.Name = "Sheet1" End If End Sub

详见例子 请参谋【明确命令禁绝改动专门的学业表名称 Chijanzen】

检查实验EXCEL建立时间

Sub CreateDate() On Error Resume Next rw = 1 Worksheets(1).Activate For Each p In ActiveWorkbook.BuiltinDocumentProperties Cells(rw, 1).Value = p.Name Cells(rw, 2).Value = ActiveWorkbook.BuiltinDocumentProperties(p.Name) rw = rw 1 Next MsgBox ActiveWorkbook.BuiltinDocumentProperties("Creation date") End Sub

Rename CodeName

2020欧洲杯冠军竞猜官方网站 29点击浏览该文件

2020欧洲杯冠军竞猜官方网站 30

钦命计算机上运维 19/F

能够监督删除行及列吗 20/F

列出富有工作薄的 VBA 21/F

vba 程式碼(代碼)是还是不是限制体量不得超過 64K 限制嗎 23/F

找格式化的顏色 ( Font 及 Interior) 请参考 找格式化的顏色 ( Font 及 Interior)

有未有法子在EXCEL的行事表里插入一张会动的gif 动画

请参考(向我们推荐三个足以在SHEET中选用的gif动画插件)

请参照他事他说加以考察(不用控件也来呈现GIF动画)

何以一开垦职业簿,关闭所有职业表,剩 sheet1 为活动职业表

请参考
点击浏览该文件 , 用飞快键 CRTL s 可转移下一页,以往独有三页(能够扩充)

什么样另存文件时不保留文件的宏

请参照他事他说加以考察 (在背景作業中另存新檔 chijanzen)

搜索自定范围名称左上、左下、右上及右下地址

请参考 2020欧洲杯冠军竞猜官方网站 31点击浏览该公文

请教如何在单元格里获取页码和总页数

请参谋(请教如何在单元格里获得页码和总页数)

加長 驗證 的長度及寬度

请参考 加長 驗證 的長度及寬度

什么转移列表框下拉的字体魄式

Excel 自个儿自帶的驗證下拉列表是沒有這功用,可用 Combox 格局,請參考附属类小部件

2020欧洲杯冠军竞猜官方网站 32点击浏览该公文

请问全屏展现后,怎么着不显得“关闭全屏展现”工具栏

Sub hidebar() ' chijanzen Application.CommandBars(1).Enabled = False Application.DisplayFullScreen = True Application.CommandBars("Full Screen").Visible = False With ActiveWindow .DisplayHorizontalScrollBar = False .DisplayVerticalScrollBar = False End With End Sub Sub unhidebar() Application.CommandBars(1).Enabled = True Application.DisplayFullScreen = False With ActiveWindow .DisplayHorizontalScrollBar = True .DisplayVerticalScrollBar = True End With End Sub

哪些遮盖windows上面包车型地铁职责栏 请参照他事他说加以考察【遮蔽任务栏】

能够在不影响活页薄情形下显得时间吗

请参谋【在工具列新扩大1个常驻的电子时钟Chijanzen】

请参考 Ivan F Moala 2020欧洲杯冠军竞猜官方网站 33点击浏览该文件

怎么样决断空专门的职业表?并机关删除

If IsEmpty(ActiveSheet.UsedRange) And ActiveSheet.Shapes.Count = 0 Then ActiveSheet.Delete

采纳年限設定

For Each WS In ActiveWorkbook.Worksheets
With WS
On Error Resume Next
Set Rng1 = Cells.SpecialCells(xlCellTypeFormulas, 23)

Sub CheckFileDate()
Dim Counter As Long, LastOpen As String, Msg As String
If RegRead = "" Then
Term = 0 '範例用 0 天
TermDate = DateSerial(Year(Now), Month(Now), Day(Now)) Term
MsgBox "本檔案只能动用到" & TermDate & "日" & Chr(13) & "超過期限將自動銷毀"
RegWrite (Term)
Else
If CDate(RegRead) <= Now Then
RegDelete
KillMe
End If
End If
End Sub
Sub KillMe()
Application.DisplayAlerts = False
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkbook.FullName
ThisWorkbook.Close False
End Sub

Function GetComputerName()
Dim sComputerName As String
Dim lComputerNameLen As Long
Dim lResult As Long
lComputerNameLen = 256
sComputerName = Space(lComputerNameLen)
lResult = w32_GetComputerName(sComputerName, lComputerNameLen)
If lResult <> 0 Then
GetComputerName = Left(sComputerName, lComputerNameLen)
Else
GetComputerName = "Unknown"
End If
End Function

Public Sub MakeNormal(hwnd As Long)
SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub
Public Sub MakeTopMost(hwnd As Long)
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub

防止 Excel 關閉

可以监督删除行及列吗

2020欧洲杯冠军竞猜官方网站 34

Function UserName() As String
Dim Buffer As String * 100
Dim BuffLen As Long
BuffLen = 100
GetUserName Buffer, BuffLen
UserName = Left(Buffer, BuffLen - 1)
End Function

2020欧洲杯冠军竞猜官方网站 35

Option Explicit

' Get the size of the file created
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.getfile(tempPath)
result = ComName & " uses " & (a.Size / 1000) & " KB."

MicroSoft 沒有文件顯示 編碼 的分寸限制
64K 太大,很難跟進

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Const dFixedPos As Double = "0.8"
Const dFixWidth As Double = "16" 'Change here to change WIDTH of the DropDown
Dim vld As Validation
Dim lDpdLine As Long

On Error Resume Next
oDpd.Delete
sFml1 = vbNullString
Set oDpd = Nothing
On Error GoTo 0

编辑:办公软件 本文来源:Excel怎么抓取网络数据,X3总结密闭曲线长度和面

关键词: 欧洲杯竞猜