zoukankan      html  css  js  c++  java
  • excel录制宏的基础上,加了几句(导入文本数据生成折线)

    Sub 宏1()
    '
    ' 宏1 宏
    '
    Name = "test3"
    Worksheets.Add after:=Worksheets(Worksheets.Count)
    ActiveSheet.Name = Name
    '
        With ActiveSheet.QueryTables.Add(Connection:= _
            "TEXT;C:UsersAdministratorDesktop" & Name & ".txt", Destination:=Range("$A$2"))
            .Name = "test"
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .TextFilePromptOnRefresh = False
            .TextFilePlatform = 936
            .TextFileStartRow = 1
            .TextFileParseType = xlDelimited
            .TextFileTextQualifier = xlTextQualifierDoubleQuote
            .TextFileConsecutiveDelimiter = True
            .TextFileTabDelimiter = True
            .TextFileSemicolonDelimiter = False
            .TextFileCommaDelimiter = False
            .TextFileSpaceDelimiter = True
            .TextFileColumnDataTypes = Array(1, 1)
            .TextFileTrailingMinusNumbers = True
            .Refresh BackgroundQuery:=False
        End With
        Application.Left = 352.75
        Application.Top = 66.25
        Range("B1").Select
        ActiveCell.FormulaR1C1 = "kang_" & Name
        Columns("B:B").Select
        ActiveSheet.Shapes.AddChart.Select
        ActiveChart.ChartType = xlLine
        ActiveChart.SetSourceData Source:=Range(Name & "!$B:$B")
    End Sub
    

      

  • 相关阅读:
    对offsetHeight,clientHeight,scrollHeight的理解
    对word-wrap和word-break的理解
    数据结构之线性表(严蔚敏《数据结构》要求)
    1-数据结构之线性表
    结构体变量声明及初始化的的那些坑
    指针与函数
    数组的深入理解
    0-绪论
    别让无知成恶趣!
    电路分析-3
  • 原文地址:https://www.cnblogs.com/konkon/p/7680967.html
Copyright © 2011-2022 走看看