指定值添加上升下降箭头公式
=TEXT(AL5/AU5,"0.00%") & IF(AL5/AU5>AF15,"↑",IF(AL5/AU5<AF15,"↓",""))
指定值添加添加说明
=IF(B3/Q3>B7,"上升"&TEXT(B3/Q3-B7,"0.00%"),IF(B3/Q3<B7,"下降"&TEXT(B7-B3/Q3,"0.00%"),"持平"))
Sub StaticRow()
'改变行中的内容
Dim SheetIndex, StaticRow, staticCommetIndex, intStart, intEnd,ColumnIndex
SheetIndex = "Sheet1" '必须的,要修改的sheet
StaticRow = 21 '必须的:要修改的 固定 行的索引,
staticCommetIndex = 10 '必须的,备注的固定行
intStart = Asc("b") - 96 '必须的,开始循环开始的 小写 字母
intEnd = Asc("p") - 96 '必须的,循环的结束的 小写 字母
ColumnIndex = "" '要变的列的索引,如果有初始值
For ColumnIndex = intStart To intEnd
Worksheets(SheetIndex).Cells(StaticRow, ColumnIndex).ClearComments
strComment = Worksheets(SheetIndex).Cells(staticCommetIndex, ColumnIndex).Value
With Worksheets(SheetIndex).Cells(StaticRow, ColumnIndex).AddComment
.Visible = False
.Text "作者:" & Chr(10) & strComment & Chr(10) & Date
End With
Next ColumnIndex
End Sub
Sub StaticColumn()
'改变列中的内容
Dim SheetIndex, RowIndex, StaticRow, StaticColumn, staticCommetIndex
SheetIndex = "Sheet1" '要修改的sheet
RowIndex = "" '要变的行的索引,如果有初始值
StaticColumn = 1 '固定的列的索引,如果有初始值
staticCommetIndex = 2 '备注的固定列
intStart = 28
intEnd = 38
For RowIndex = intStart To intEnd
Worksheets(SheetIndex).Cells(RowIndex, StaticColumn).ClearComments
strComment = Worksheets(SheetIndex).Cells(RowIndex, staticCommetIndex).Value
With Worksheets(SheetIndex).Cells(RowIndex, StaticColumn).AddComment
.Visible = False
.Text "要添加的备注" & Chr(10) & strComment & Chr(10) & Date
End With
Next RowIndex
End Sub