Excel VBA 学习笔记13:单元格的格式

Excel VBA 学习笔记13:单元格的格式
NumberFormat 属性 (Excel)
vba excel 单元格格式设置
Excel VBA 单元格格式
python解决SNIMissingWarning和InsecurePlatformWarning警告
Visual Basic 语言参考
VBA字符串处理大全-from EH

Option Explicit

Sub text()
    'Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete '找A列所有空单元格,然后删除空单元格所在行
    'Range("A1:D12").SpecialCells(xlCellTypeBlanks).Activate
    Range("A1:D12").SpecialCells(xlCellTypeLastCell).Activate
    Debug.Print Range("A1:D12").SpecialCells(xlCellTypeBlanks).Count
    Debug.Print Range("A1:A13").SpecialCells(xlCellTypeBlanks).Count
    
    
End Sub
Sub 删除空行()

Dim rng As Range, ads As String, ad As String


For Each rng In [a1:a14]

  If rng = "" Then ad = ad & rng.Address & ","

Next

ads = Left(ad, Len(ad) - 1)
Debug.Print ads
Debug.Print Range(ads).Address




'Range(ads).EntireRow.Delete

End Sub
Sub xx()
    Range("A1:L6").Columns.AutoFit
End Sub
Option Explicit

Sub 宏1()
'
' 宏1 宏
'

'
    Columns("E:F").Select
End Sub
Sub 宏2()
'
' 宏2 宏
'

'
    Range("B2:C8").Select
    ActiveSheet.Shapes.AddChart2(227, xlLine).Select
    ActiveChart.SetSourceData Source:=Range("工作簿1!$B$2:$C$8")
    ActiveSheet.Shapes("图表 1").IncrementLeft -115.8
    ActiveSheet.Shapes("图表 1").IncrementTop 48
    ActiveChart.PlotArea.Select
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    ActiveChart.FullSeriesCollection(1).Delete
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.FullSeriesCollection(1).Name = "=工作簿1!$B$4:$C$4"
    ActiveChart.FullSeriesCollection(1).Values = "=工作簿1!$H$4:$K$4"
    ActiveChart.FullSeriesCollection(1).XValues = "=工作簿1!$H$1:$K$1"
    ActiveChart.ChartArea.Select
    ActiveSheet.Shapes("图表 1").ScaleWidth 1.0741666667, msoFalse, _
        msoScaleFromTopLeft
    ActiveSheet.Shapes("图表 1").ScaleHeight 1.0583333333, msoFalse, _
        msoScaleFromBottomRight
    ActiveSheet.Shapes("图表 1").IncrementLeft 15.6
    ActiveSheet.Shapes("图表 1").IncrementTop 49.8
End Sub
Sub 宏3()
'
' 宏3 宏
'

'
    Range("G2").Select
    Selection.Copy
    Range("H6:K6").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Range("K8").Select
End Sub

你可能感兴趣的:(Excel VBA 学习笔记13:单元格的格式)