Excel 在单元格中键入文本时复制表格
我有excel表格 我需要设置何时有人键入文本到最后一个单元格,以便excel将自动复制整个表到新列表中,以便继续将下一个数据填充到新列表中 对不起,我是Excel的初学者。我可能需要设置“IF”语句来启动宏,将表复制到新列表。但我不知道怎么做Excel 在单元格中键入文本时复制表格,excel,Excel,我有excel表格 我需要设置何时有人键入文本到最后一个单元格,以便excel将自动复制整个表到新列表中,以便继续将下一个数据填充到新列表中 对不起,我是Excel的初学者。我可能需要设置“IF”语句来启动宏,将表复制到新列表。但我不知道怎么做 提前感谢您提供的每一个提示和建议此宏将检查A30是否为运行此,如果是,则将A1通过A29复制到从B1开始的区域。如果希望其中任何一个不同,则必须修改脚本。要创建宏,请右键单击电子表格底部的工作表名称(Sheet1),然后选择View code Priva
提前感谢您提供的每一个提示和建议此宏将检查
A30
是否为运行此
,如果是,则将A1
通过A29
复制到从B1
开始的区域。如果希望其中任何一个不同,则必须修改脚本。要创建宏,请右键单击电子表格底部的工作表名称(Sheet1
),然后选择View code
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("A30:A30")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' This will check to see if cell A30 is equal to RUN_THIS and It then
' copies the values from A1 through A29 to the space starting at B1
Worksheets("Sheet1").Range("A30").Select
If Worksheets("Sheet1").Range("A30").Value = "RUN_THIS" Then
Range("A1:A29").Select
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
Range("D15").Select
End If
End If
End Sub
此宏检查
A30
是否为运行此,如果为A1
通过A29
复制到从B1
开始的区域。如果希望其中任何一个不同,则必须修改脚本。要创建宏,请右键单击电子表格底部的工作表名称(Sheet1
),然后选择View code
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("A30:A30")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' This will check to see if cell A30 is equal to RUN_THIS and It then
' copies the values from A1 through A29 to the space starting at B1
Worksheets("Sheet1").Range("A30").Select
If Worksheets("Sheet1").Range("A30").Value = "RUN_THIS" Then
Range("A1:A29").Select
Selection.Copy
Range("B1").Select
ActiveSheet.Paste
Range("D15").Select
End If
End If
End Sub
有任何文本或类似于RUN_THIS的特定内容吗?Excel中的哪个单元格?有文本或类似于此的特定内容吗?Excel中的哪个单元格?@user2166133如果您认为这可以接受,请单击向下的大箭头接受。单击向上箭头并不表示您已接受它。谢谢@用户2166133请单击大的向下箭头“接受”此选项。单击向上箭头并不表示您已接受它。谢谢@用户2166133如果您认为这是可以接受的,请单击大的向下箭头接受这一点。单击向上箭头并不表示您已接受它。谢谢@用户2166133请单击大的向下箭头“接受”此选项。单击向上箭头并不表示您已接受它。谢谢