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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值