我不仅要将此公式应用于B2单元格,而且要应用于整个B列。
constructor(private router: Router) {
router.events.subscribe(() => shouldGetDresses());
}
private shouldGetDresses() {
this.dressService.getDresses().subscribe(res => {
this.dress = res;
});
}
任何帮助将不胜感激。
答案 0 :(得分:1)
类似这样的东西:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range, c As Range, rngCol As Range
'Get the range from the table column header
Set rngCol = Me.ListObjects("myTable").ListColumns("Col2").DataBodyRange
'EDIT: alternative for multiple contiguous columns
Set rngCol = Me.Range("myTable[Col2]:myTable[Col4]")
'any changes in the monitored column?
Set rng = Application.Intersect(Target, rngCol)
If Not rng Is Nothing Then '<< got some changes in ColB
Application.EnableEvents = False
For Each c In rng.Cells
If IsNumeric(c.Value) Then
'Update: only apply to values >1
If c.Value > 1 Then c.Value = c.Value / 100000000
End If
Next c
Application.EnableEvents = True
End If
End Sub
(已编辑以显示对Table / ListObject的使用)