>

【乐百家软件】FAQ 职业薄及专业表

- 编辑:乐百家599手机首页 -

【乐百家软件】FAQ 职业薄及专业表

Step1:使用“获取和转变”效率将网络数据抓取至Excel中

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

乐百家软件 1

弹出如下窗口,手动将百度健全“奥运会”的网站复制粘入U812 SuperfastL栏,并点击明确。

乐百家软件 2

Excel与网页连接要求一按期期,稍等片刻后会弹出如下窗口,侧面列表中的各样Table都意味着该网页中的二个报表,挨个点击预览后意识,Table3是大家所需的数额。

乐百家软件 3

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

乐百家软件 4

在弹出的窗口中,在“选用想要在办事薄中查看此数据的法子”下抉择“表”,并点击加载。

乐百家软件 5

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

乐百家软件 6

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

乐百家软件 7

乐百家软件 ,Private Sub UpdateControls()
    Dim bEnabled As Boolean
   
    cLength.Enabled = bValidSelection
    EnableTextControl txtLength, bValidSelection
    lblUnitLength.Enabled = bValidSelection

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

' Sheets("分界面").Select '为了合营开关放到任何表中

Excel抓取并询问网络数据可以利用“获取和转移” “查找引用函数”的功用整合来贯彻。

Private Sub cboUnits_Change()
    OnUnitChange cboUnits.ListIndex
End Sub

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

Sub 更新WMS秘钥()
If 进度命令("SmartQueryTwo.exe") <> "" Then
[H1] = Split(进度命令("斯马特QueryTwo.exe"), ",")(5)
End If
End Sub

一经是平常职责多,且有鲜明的基本功,学习一下未必不可。

老猫是经过VBA操作的,写八个代码,抓取数据,也很便利。

老猫正在开荒的一款足彩软件程序救市从网络抓取大批量数量。然后深入分析和展望足彩。

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

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

Function 联网提示(url)
If 测网(url) = 0 Then
tip = 提姆e & " 请确认是还是不是连接上集团内网。"
Debug.Print tip
MsgBox tip
End
End If
End Function

那是VBA程序代码

乐百家软件 8

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

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

' Set sGet = Nothing '清除文件流

例:下图是百度百科“奥林匹克运动会”网页中的一个表格,大家以此为例落成抓取该表格至Excel中,并且能够透过输入第几届来查询相应的开设城市。

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

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

        Application.ScreenUpdating = True '启用屏幕更新
        Range("E" & ri).Select '显示进度
        Application.ScreenUpdating = False '禁用屏幕更新
        If tip = Empty Then
            Range("E" & ri) = Time - t1
        Else
            Range("E" & ri) = tip
        End If
    End If

    '导入
    If dr = 1 Then
    If Range("C" & ri) <> "" Then '用导入表名判断,不导入的可以不填表名,这样不用去掉网址
    If Dir(fn, 16) <> Empty Then '路径不存在不运行,这里不加的话kill fn会报错
        s = Range("C" & ri)
        tip = 导入表(fn, s)
        Kill fn '删除文件

        Sheets(ssh).Select '打开导入过程选定表会变化,所以重新选定
        Application.ScreenUpdating = True '启用屏幕更新
        Range("E" & ri).Select '显示进度
        Application.ScreenUpdating = False '禁用屏幕更新
        If tip = Empty Then
            Range("E" & ri) = Time - t1
        Else
            Range("E" & ri) = tip
        End If
    End If
    End If
    End If
End If
Next

乐百家软件 9

Private Sub cVolume_Click()
乐百家599手机首页 ,    UpdateControls
End Sub

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

Function 表存在(s)
For Each i In Sheets
If i.Name = s & "" Then 表存在 = 1 '连接空白是防止表格名称叫数值时格式分化
' Debug.Print i.Name = s
Next
End Function

那是抓取的赔率数据

乐百家软件 10

简单来说,假诺想学是轻而易举的。

回答:

以EXCEL二零零一为例来给你作证。

一、首先打开EXCEL二〇〇四,在菜单栏找到“数据”然后在下拉菜单点击“导入外界数据-新建WEB查询”
乐百家软件 11
二、然后在开垦的对话框中的地址栏中,将您要导入的网站输入进去,按下转到按钮。
乐百家软件 12
三、在弹开的对话框中原则须求导入的区域,按下导入开关,这一年,数据就被导入到EXCEL里面啦!
乐百家软件 13最后,你的微型Computer得链接网络,要不未有数量,那样导入的平价是,能够和网址上保持一致,没有供给进行手动更新,很便利。

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

' Module

' 联网提示("http://ssa.jd.com/sso/login")

尽管只是不常有其一职务,依然在互连网出点钱,找人做了。

开销的钱确实非常的少。几百元丰盛了。

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

' Delete the exported file
fs.Deletefile tempPath

Function 测网(url)
On Error Resume Next
cmdping = "ping " & url & " -n 1"
Set oExec = CreateObject("Wscript.shell").exec(cmdping)
Do Until oExec.stdout.AtEndOfStream
strline = strline & oExec.stdout.readline() & Chr(13)
Loop
测网 = 0
If InStr(strline, "回复") Then 测网 = 1
Set oExec = Nothing
End Function

Step2:使用“查找与引用”函数完结数据查询

创设查询区域,满含“届数”和“主办城市”,在届数中随性所欲采用一届输入,下图输入“第08届”,在主持城市下输入vlookup函数,能够赢得第08届奥运会的牵头城市是巴黎,当更动届数时,对应的主持城市也随即退换。

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

乐百家软件 14

注意点:若网页中的数据变动较频仍,则足以设置链接网页的数目定时刷新:

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

乐百家软件 15

②在弹出的对话框中,设置,比方设置为10分钟实行刷新。这样,每隔10分钟数据就能够刷新贰次,时刻有限支撑收获的多少位最新的。

乐百家软件 16


style="font-weight: bold;">「精进Excel」系头条签订契约小编,关切自己,假设放肆点开三篇文章,未有你想要的知识,算作者耍流氓!

回答:

世家好,作者是@Excel实例录像网址长@接待私信恐怕邀约笔者回答Excel相关难题!


有人在群里问手机号怎么批量查归属地,第一深感是百度时而,结果还真没找到好用的,既然如此,笔者就和睦写几个吗!首先找了多少个webapi,找到个非常好用的,就用vba写了个自定义函数,测验下感觉如故相当好用,速度也挺快

乐百家软件 17

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

回答:

标准的人做正经作业。

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

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

ssh = ActiveSheet.Name '为了兼容按钮放到其他表中

那是抓取的交锋列表:

乐百家软件 18

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

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

' Sheets(ssh).Select '为了合营按键放到任何表中
End Sub

问题:在日常干活中会遇到,知道在那之中一个数量,举例姓名,在报表中输入人名后,想要自动带出网页中该姓名对应的连带数据,比方该姓名的电电话机,地址等音信,怎样产生吗?

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

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

' End If

回答:

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

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

Function attfn(http)
attfn = Replace(decodeURI(http.getResponseHeader("Content-Disposition")), "attachment;filename=", "")
End Function

Private vLength As Double
Private vArea As Double

钦点计算机上运维

' If InStr(http.responsetext, "not support") > 0 Then
' tip = Time & " " & Range("B" & ri) & " 方法不当,请在网页中登入后运营,或转移有权力账号。"
' Debug.Print tip
'' MsgBox tip
' Else

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

Option Explicit

        Set sGet = CreateObject("ADODB.Stream") '下载文件
            sGet.Mode = 3
            sGet.Type = 1
            sGet.Open
            sGet.Write (http.responseBody)
            sGet.SaveToFile SaveTo & fn, 2

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

Sub BreakExternalLinks()

Sub 自动下载导入(Optional dr)
If IsMissing(dr) Then dr = 1 '为加了Optional的可选择性省略参数设定值
'多谢您查看本表源码,本源码和设计格局为自个儿原创,开源供交换学习, 失常能够交换自个儿gzlinwancheng@jd.com 13570972484
'
'2014年1四月十七日用通过查阅会话关闭后失效的Cookie找到库存查询秘钥sso.jd.com设计出查ERP仓库储存表格
'二零一四年十月17日用ERP账号密码Post成功,设计出新的查仓库储存与查订单站点表格给质量控制客服使用
'2016年11月28日 成功用Post后的Cookie打开JA表格
'2016年11月29日 成功用Post后的Cookie下载JA表格,分享
'二〇一四年一月四日 安息日加班,增添批量导入等制作自动表的代码
'2014年一月二二十三日 以早报举例,扩大时间记下,合併下载和导入两片段代码
'二零一六年3月13日达成WSG库房产和土地资金财产管理家、SRM供应商预定系统Post导入,并调治Post/Get参数到表中安装
'二〇一四年6月30日下载地址参数用相对引用$,以防复制粘贴到分化行时变化,增加表达
'二零一四年3月10日编写Post下载地址获取表达,改动保留路线公式Cell函数增加参数防止选定其余表时地址更换
'二零一七年0二月24日扩张File下载、手动导入、导入到已有钦命列、导入并填充左右相邻公式(不要求填充的永不相邻)、
' CSV导入使用数据导入并只在第叁回机关调解裂开,第二行高于15人的列自动安装文本避免数据错失
' 撤废包容开关屏弃何表,分界面表名可修改可多账号
' 时间提示创新,找不到对应列不导入避防公式表被破坏
' 快过大年了仍把前天天下太平和明儿早上突击用来写代码,京东守旧与程序猿的作者修养哈哈哈
'前年0三月01日 手动导入增扩充文本支持
'前年03月08日 csv文件导入时去掉原列内容,删除查询定义连接
'二零一七年0六月29日 完毕WMS数据自动抓取
'by 京东商号马尼拉欧洲一号小件库 仓库储存质量控制部 园区质量控制岗 林万程

 乐百家软件 19

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

Function decodeURI(szInput)
Set js = CreateObject("MSScriptControl.ScriptControl")
js.Language = "JScript"
decodeURI = js.Eval("decodeURI('" & szInput & "')")
End Function

 

'// 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)

Sub 下载导入()
关闭功用
自行下载导入 (1)
开启效能
End Sub

Private Sub cPrecision_Change()
    UpdateValues
End Sub

'// 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.

'File下载文件有关函数申明
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Declare Function DeleteUrlCacheEntry Lib "wininet" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long

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

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

Set http = CreateObject("Msxml2.ServerXMLHTTP")
    '登录
    http.Open "post", "http://ssa.jd.com/sso/login", False
    http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    Data = "username=" & [B2] & "&password=" & [B3] & "" '【ERP账号密码所在位置】
    http.send (Data)

    If InStr(http.responsetext, "登录超时") > 0 Then
        tip = Time & " 登录超时,ERP账号密码错误或未填写。"
        Debug.Print tip
        MsgBox tip
        End
    End If

'下载
For ri = 5 To [H1048576].End(xlUp).Row
If Range("B" & ri) <> "" Then '用下载表名判断,不导入的可以不填表名,这样不用去掉网址
    t1 = Time
    '报表下载保存地址
    ph = Range("A" & ri)
    If ph = "" Then ph = ThisWorkbook.path
    fn = ph & "" & Range("B" & ri) & "." & Range("F" & ri)
    If Range("G" & ri) = "File" Then
        lngRetVal = URLDownloadToFile(0, Range("H" & ri), fn, 0, 0)
        If lngRetVal = 0 Then DeleteUrlCacheEntry Range("H" & ri)
    ElseIf Range("G" & ri) = "WMS" Then
        sq = [H1]
        sqt = Range("H" & ri)
        Workbooks.Add
        With ActiveSheet
        With ActiveSheet.ListObjects.Add(SourceType:=0, Source:= _
            "ODBC;DRIVER={MySQL ODBC 5.3 Unicode Driver};" & sq, _
            Destination:=.Range("A1")).QueryTable
            .CommandText = sqt
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlOverwriteCells '插入模式=覆盖(还有插入行和插入列选择)f
            .SavePassword = True '保存密码
            .SaveData = True
            .AdjustColumnWidth = Ture
            .RefreshPeriod = 0 '刷新频率单位秒,0不自动刷新
            .PreserveColumnInfo = True
            .ListObject.DisplayName = "万程的缩写是WC"
            .Refresh BackgroundQuery:=False
            .Delete '删除查询定义
        End With
        End With
        ActiveWorkbook.SaveAs FileName:=fn, FileFormat:=xlCSV, CreateBackup:=False
        ActiveWindow.Close
    Else
        http.Open Range("G" & ri), Range("H" & ri), False
        http.send ("")
        DoEvents '防止程序假死

        Debug.Print attfn(http)

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

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

ri = 5

'================= 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

测量检验 WorkSheet 是还是不是留存

Sub 批量下载()
电动下载导入 (0)
End Sub

'================= 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

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

Function 建表(s)
For Each i In Sheets
If i.Name = s Then Exit Function
Next
Sheets.Add(, ThisWorkbook.Sheets(Sheets.Count)).Name = s
' Sheets.Add.Name = s'创制在前边
' Sheets.Add 方法 (Excel):https://msdn.microsoft.com/zh-cn/library/office/ff839847
End Function

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

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

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

能够监察和控制删除行及列吗

Private colDict As New Collection
Private bMetric As Boolean

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 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

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

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

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

防止 Excel 關閉

本文由乐百家软件发布,转载请注明来源:【乐百家软件】FAQ 职业薄及专业表