那就把它改成
Sub CellValidation() ' stillfish00 提供
ro = Sheets("Sheet2").[A65535].End(xlUp).Row
With Sheets("Sheet2").[A2:A25].Validation
.Delete
.Add Type:=xlValidateList, Formula1:="=Sheet1!$A$3:$A$" & ro
End With
End Sub
然後 把下面這段貼到最後面,這樣當你Activate工作表2時,就會自動幫你更改
Private Sub Worksheet_Activate()
CellValidation
End Sub作者: av8d 時間: 2016-10-11 16:17
Sub CellValidation() ' stillfish00 提供
'ro = Sheets("Sheet2").[A65535].End(xlUp).Row
ro = Sheets("Sheet1").[A65535].End(xlUp).Row '選單內容
With Sheets("Sheet2").[A2:A25].Validation
.Delete
.Add Type:=xlValidateList, Formula1:="=Sheet1!$A$3:$A$" & ro
End With
End Sub
然後 把下面這段貼到最後面,這樣當你Activate工作表2時,就會自動幫你更改
Private Sub Worksheet_Activate()
CellValidation
End Sub作者: av8d 時間: 2016-10-17 00:39