旅行excel模板
明细账、总账、会计报表excel电子表格记账模板自动生成报表的怎?
试试这个宏看看—— Option Explicit Sub CreateReport() On Error Resume Next Application.ScreenUpdati
明细账、总账、会计报表excel电子表格记账模板自动生成报表的怎?
试试这个宏看看—— Option Explicit Sub CreateReport() On Error Resume Next Application.ScreenUpdating = False Dim wst As Worksheet, c As Range, i%, j%, intCol% With ActiveSheet Set wst = Worksheets.Add(After:=Sheets(Worksheets.Count)) wst.[A1] = "EVT/DVT TEST PLAN FORM" wst.[A2] = JoinString(.Range("A3:D" & Application.Match("Item", .[A:A], 0) - 1)) Set c = .[B:B].Find("Leakage ID", LookIn:=xlValues) End With With wst If Not c Is Nothing Then c.CurrentRegion.Copy .[A3] .Cells.ClearFormats For i = 3 To .[BZ4].End(xlToLeft).Column - 3 Step 2 For j = 5 To .[A65536].End(xlUp).Row If Len(.Cells(j, i)) = 0 Then .Cells(j, i) = Application.Substitute(.Cells(j, i + 1), .Cells(3, i), "") End If Next j Next i .Columns(2).Delete For i = 2 To .[BZ4].End(xlToLeft).Column If Len(.Cells(3, i)) = 0 Then .Cells(3, i).EntireColumn.Delete Next i .Columns(Application.CountA(.Rows(3))).Delete .[A3:A4].Merge intCol = .[BZ3].End(xlToLeft).Column .Range(.Cells(1, 1), .Cells(1, intCol)).Merge .Range(.Cells(2, 1), .Cells(2, intCol)).Merge .Range(.Cells(3, intCol - 2), .Cells(4, intCol - 2)).Merge .Range(.Cells(3, intCol - 1), .Cells(4, intCol - 1)).Merge .Range(.Cells(3, intCol), .Cells(4, intCol)).Merge .Rows(.[A:A].Find("Total:", LookIn:=xlValues).Row & ":" & 65536).Clear .[A1].Font.Bold = True .Rows(2).RowHeight = 140 .[A2].WrapText = True .[A3].Resize(.[A3].CurrentRegion.Rows.Count - 2, .[A3].CurrentRegion.Columns.Count).Borders.LineStyle = xlContinuous .[A1].CurrentRegion.HorizontalAlignment = xlCenter .Range(.Cells(4, 1), .Cells(4, .[A3].CurrentRegion.Columns.Count)).WrapText = True .Range(.Cells(3, 1), .Cells(3, .[A3].CurrentRegion.Columns.Count)).Font.Bold = True .[A1].CurrentRegion.Font.Size = 10 .[A1].CurrentRegion.Columns.AutoFit .[A1].Font.Size = 14 End If End With Set wst = Nothing Set c = Nothing Application.ScreenUpdating = True End Sub Function JoinString(rng As Range) Dim i%, str$ For i = 1 To Int(rng.Cells.Count / 4) str = str & rng.Cells(i, 1) & rng.Cells(i, 2) & " " & rng.Cells(i, 3) & rng.Cells(i, 4) & vbCrLf Next JoinString = Left(str, Len(str) - 1) End Function
100分!EXCEL的行自动填成红色和兰色的问题。
以下EXCEL
选中一个单元格,然后点击标题栏中的数据--有效性--设置--有效性条件--允许那一栏中选序列,然后在下边的格中填入你要选择的条,例如,A,B,C,D 确定,注意,选项中间用英文方式下的逗号分隔。
这样,你刚才选中的单元格就会出现一个小选项按钮,是一个小黑三角,点一下就会出现A,B,C,D 三个选项。
本文来自投稿,不代表本站立场,如若转载,请注明出处。