指定值添加上升降低箭頭公式索引
=TEXT(AL5/AU5,"0.00%") & IF(AL5/AU5>AF15,"↑",IF(AL5/AU5<AF15,"↓",""))it
指定值添加添加說明循環
=IF(B3/Q3>B7,"上升"&TEXT(B3/Q3-B7,"0.00%"),IF(B3/Q3<B7,"降低"&TEXT(B7-B3/Q3,"0.00%"),"持平"))im
Sub StaticRow()static
'改變行中的內容tar
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