当前位置:   article > 正文

python与vba比较_VBA处理数据与Python Pandas处理数据案例比较

vba和python处理数据

Option Base 1

Option Explicit

Sub main()

On Error GoTo error_handling

Dim wb As Workbook

Dim wb_out As Workbook

Dim sht As Worksheet

Dim sht_out As Worksheet

Dim rng As Range

Dim usedrows As Byte

Dim usedrows_out As Byte

Dim dict_cnum_company As Object

Dim str_file_path As String

Dim str_new_file_path As String

'assign values to variables:

str_file_path = "C:Users12078DesktopPythonCNUM_COMPANY.csv"

str_new_file_path = "C:Users12078DesktopPythonCNUM_COMPANY_OUTPUT.csv"

Set wb = checkAndAttachWorkbook(str_file_path)

Set sht = wb.Worksheets("CNUM_COMPANY")

Set wb_out = Workbooks.Add

wb_out.SaveAs str_new_file_path, xlCSV 'create a csv file

Set sht_out = wb_out.Worksheets("CNUM_COMPANY_OUTPUT")

Set dict_cnum_company = CreateObject("Scripting.Dictionary")

usedrows = WorksheetFunction.Max(getLastValidRow(sht, "A"), getLastValidRow(sht, "B"))

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/661889
推荐阅读
相关标签
  

闽ICP备14008679号