屏幕更新不会更改为false

时间:2019-10-23 12:43:26

标签: excel vba

我需要通过激活它来处理单元格,但是正在显示另一个工作表中的另一个单元格,因此在显示用户窗体ScreenUpdating之前将其设置为false。在用户窗体中,当选中下面的一个复选框时,代码将运行以在工作表之间切换,以便从sheet1中选择一些数据,然后在仍激活前一个单元格的情况下显示sheet2。 These are the sheets i need to switch between

Application.ScreenUpdating = True
Sheets("Sheet1").Select

Set rRange = Application.InputBox(Prompt:= _
               "Please select the Ticket ID with your Mouse.", _
                   Title:="Title", Default:="", Type:=8)
Sheets("Sheet2").Activate

Application.ScreenUpdating = false

Sheets("Sheet1").Activate  ' previous cell row number is stored in Sheets("Sheet2").Range("A1")
Sheets("Sheet1").Cells(Sheets("Sheet2").Range("A1").Value, Sheets("Sheet1").Rows(1).Find("head1", , xlValues, xlWhole).Column).Activate

0 个答案:

没有答案