我需要帮助才能将相同的细胞内容放入不同的细胞中。
我在单元格A1 - B1 - C1 - D1 - E1 - F1中有数字。 我想将这些值分别放入以下单元格中: H1 - I1 - J1 - K1 - L1 - M1。
我希望这些值保留在这些单元格中,每当我将单元格A1更新为F1时,我想将它们的值设置为H2到M2
每当我将A1更新为F1时,再次将其值变为H3到M3,依此类推。 非常感谢你的帮助。
我不确定这种解释是否更好。再次感谢您的帮助。
答案 0 :(得分:0)
希望这有帮助
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Dim goout As Boolean
goout = False
xrow = 1
Set KeyCells = Range("A1:F1")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
xcolumn = Range(Target.Address).column
Do
If Cells(xrow, xcolumn + 7).Value = "" Then
Cells(xrow, xcolumn + 7).Value = Cells(1, xcolumn).Value
goout = True
Else
xrow = xrow + 1
End If
Loop Until goout = True
End If
End Sub
将此复制到您想要在
中进行活动的工作表