当我在电子表格上运行一个宏时,我会在电子表格中找到一个覆盖屏幕一部分的其他表格的叠加层,除去它的唯一方法是滚动或选择另一张表格
代码
Sub Hardware()
Application.ScreenUpdating = False
Dim x As Integer
x = ActiveSheet.UsedRange.Rows.Count
ActiveCell.SpecialCells(xlLastCell).Select
ActiveCell.EntireRow.Cells(1, 1).Offset(1, 0).Activate
Cells(x + 1, 2).Select
ActiveCell.FormulaR1C1 = InputBox("Table ID?")
Cells(x + 1, 3).Select
ActiveCell.FormulaR1C1 = InputBox("Date It Was Purchased?")
Cells(x + 1, 4).Select
ActiveCell.FormulaR1C1 = InputBox("Item Purchased?")
Cells(x + 1, 5).Select
ActiveCell.FormulaR1C1 = InputBox("Which File Tab?")
Cells(x + 1, 6).Select
ActiveCell.FormulaR1C1 = InputBox("Any Notes?")
Cells(x + 1, 7).Select
ActiveCell.FormulaR1C1 = InputBox("Quantity of item?")
Cells(x + 1, 8).Select
ActiveCell.FormulaR1C1 = InputBox("Total Cost?")
ActiveWindow.ScrollColumn = 1
Application.ScreenUpdating = True
End Sub
答案 0 :(得分:0)
它可能不是“幽灵”图像,而是您在执行VBA宏时使用的另一张图片的实际图像。
将Application.ScreenUpdating = False
添加到您的代码中,这应该可以修复它。 (一旦你完成更新/计算东西,就把它设置为真)