Excel VBA 学习笔记13:单元格的格式
NumberFormat 属性 (Excel)
vba excel 单元格格式设置
Excel VBA 单元格格式
python解决SNIMissingWarning和InsecurePlatformWarning警告
Visual Basic 语言参考
VBA字符串处理大全-from EH
Option ExplicitSub text()'Range("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete '找A列所有空单元格,然后删除空单元格所在行'Range("A1:D12").SpecialCells(xlCellTypeBlanks).ActivateRange("A1:D12").SpecialCells(xlCellTypeLastCell).ActivateDebug.Print Range("A1:D12").SpecialCells(xlCellTypeBlanks).CountDebug.Print Range("A1:A13").SpecialCells(xlCellTypeBlanks).CountEnd SubSub 删除空行()Dim rng As Range, ads As String, ad As StringFor Each rng In [a1:a14]If rng = "" Then ad = ad & rng.Address & ","Nextads = Left(ad, Len(ad) - 1)Debug.Print adsDebug.Print Range(ads).Address'Range(ads).EntireRow.DeleteEnd SubSub xx()Range("A1:L6").Columns.AutoFitEnd Sub
Option ExplicitSub 宏1()'' 宏1 宏''Columns("E:F").SelectEnd SubSub 宏2()'' 宏2 宏''Range("B2:C8").SelectActiveSheet.Shapes.AddChart2(227, xlLine).SelectActiveChart.SetSourceData Source:=Range("工作簿1!$B$2:$C$8")ActiveSheet.Shapes("图表 1").IncrementLeft -115.8ActiveSheet.Shapes("图表 1").IncrementTop 48ActiveChart.PlotArea.SelectApplication.CutCopyMode = FalseApplication.CutCopyMode = FalseApplication.CutCopyMode = FalseApplication.CutCopyMode = FalseActiveChart.FullSeriesCollection(1).DeleteActiveChart.SeriesCollection.NewSeriesActiveChart.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.SelectActiveSheet.Shapes("图表 1").ScaleWidth 1.0741666667, msoFalse, _msoScaleFromTopLeftActiveSheet.Shapes("图表 1").ScaleHeight 1.0583333333, msoFalse, _msoScaleFromBottomRightActiveSheet.Shapes("图表 1").IncrementLeft 15.6ActiveSheet.Shapes("图表 1").IncrementTop 49.8End SubSub 宏3()'' 宏3 宏''Range("G2").SelectSelection.CopyRange("H6:K6").SelectSelection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _SkipBlanks:=False, Transpose:=FalseRange("K8").SelectEnd Sub