P
Phil Floyd
I have a workbook with 50+ sheets in it. All but 2 of the sheets are
identical. In all of these identical sheets an employee # will be entered
and some formatting and formulas are added via code. Since most of the
sheets are identical, I put the code in the Workbook_SheetChange. The code
works fine but the problem is when I try to Copy & Paste on any of the
sheets, Excel freezes and I can only exit Excel from the task bar in
Windows. I am prompted to save changes and am able to do so. Below is the
code I am using. Is there some obvious reason why this is happening?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.ScreenUpdating = False
If Not Intersect(Target, Range("A7:A100")) Is Nothing Then
ActiveCell.Offset(-1, 0).Select
ActiveCell.Range("A1:K1").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
....rest of code
Thanks,
Phil
identical. In all of these identical sheets an employee # will be entered
and some formatting and formulas are added via code. Since most of the
sheets are identical, I put the code in the Workbook_SheetChange. The code
works fine but the problem is when I try to Copy & Paste on any of the
sheets, Excel freezes and I can only exit Excel from the task bar in
Windows. I am prompted to save changes and am able to do so. Below is the
code I am using. Is there some obvious reason why this is happening?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.ScreenUpdating = False
If Not Intersect(Target, Range("A7:A100")) Is Nothing Then
ActiveCell.Offset(-1, 0).Select
ActiveCell.Range("A1:K1").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
....rest of code
Thanks,
Phil