Hi,
When I have multiple excel files opened, one being the file with the code below Excel freezes.
With only this file opened it works fine.
If another file is opened and has even simple macros it seems to cause confilct. (I have checked the other files)
The problem seems to occur around the worksheet_change, (I have removed this code to test) it freezes after the List item is selected.
If the user selects 'New' in a cell with Data Validation List,
then the next cell is populated with 'TBA'
acct1_name is a named range - row 6
acct10_name is a named range - row 15
thanks..
---
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo err_handler
Dim Row As Integer
Dim Col As Integer
Dim wb As Workbook
Dim sName As String
Dim sValue As String
Application.EnableEvents = False
Set wb = ThisWorkbook
sName = LCase(wb.Name)
Row = Target.Row
Col = Target.Column
sValue = Target.Value
If (Row >= wb.Sheets("IP").Range("acct1_name").Row And Row <= wb.Sheets("IP").Range("acct10_name").Row) Then
If Col = 8 Then
If sValue = "New" Then
'wb.Sheets("IP").Cells(Row, 9) = "TBA"
wb.Sheets("IP").Range("I" & Row).Value = "TBA"
End If
End If
End If
Application.EnableEvents = True
end sub
OS : WinXP, Excel 2003
When I have multiple excel files opened, one being the file with the code below Excel freezes.
With only this file opened it works fine.
If another file is opened and has even simple macros it seems to cause confilct. (I have checked the other files)
The problem seems to occur around the worksheet_change, (I have removed this code to test) it freezes after the List item is selected.
If the user selects 'New' in a cell with Data Validation List,
then the next cell is populated with 'TBA'
acct1_name is a named range - row 6
acct10_name is a named range - row 15
thanks..
---
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo err_handler
Dim Row As Integer
Dim Col As Integer
Dim wb As Workbook
Dim sName As String
Dim sValue As String
Application.EnableEvents = False
Set wb = ThisWorkbook
sName = LCase(wb.Name)
Row = Target.Row
Col = Target.Column
sValue = Target.Value
If (Row >= wb.Sheets("IP").Range("acct1_name").Row And Row <= wb.Sheets("IP").Range("acct10_name").Row) Then
If Col = 8 Then
If sValue = "New" Then
'wb.Sheets("IP").Cells(Row, 9) = "TBA"
wb.Sheets("IP").Range("I" & Row).Value = "TBA"
End If
End If
End If
Application.EnableEvents = True
end sub
OS : WinXP, Excel 2003