Hello All, I ws wondering if someone can tell me why when I email a workbook with vba and macros some times they work and sometimes they don't. I set the security levels as low as they can go and still sometimes they work and some times they don't. Below is the VBA code that is in the workbook, I have it pasted in the individual worksheets.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim aCell As Range
If Not Intersect(Range("G3:AK190"), Target) Is Nothing Then
For Each aCell In Target
If UCase(Range("F" & aCell.Row)) <> "N" And UCase(Range("F" & aCell.Row)) <> "Y" Then
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
Exit Sub
End If
If Application.WorksheetFunction.IsText(aCell.Value) Then
If UCase(aCell.Value) = "BH" Then
If UCase(Range("F" & aCell.Row)) = "N" Or _
Cells(192, aCell.Column) < 0.9 Then
Application.EnableEvents = False
aCell.Value = 0
Application.EnableEvents = True
End If
End If
End If
Next aCell
End If
End Sub
Any suggestions for emailing workbooks to ensure it works properly when received?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim aCell As Range
If Not Intersect(Range("G3:AK190"), Target) Is Nothing Then
For Each aCell In Target
If UCase(Range("F" & aCell.Row)) <> "N" And UCase(Range("F" & aCell.Row)) <> "Y" Then
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
Exit Sub
End If
If Application.WorksheetFunction.IsText(aCell.Value) Then
If UCase(aCell.Value) = "BH" Then
If UCase(Range("F" & aCell.Row)) = "N" Or _
Cells(192, aCell.Column) < 0.9 Then
Application.EnableEvents = False
aCell.Value = 0
Application.EnableEvents = True
End If
End If
End If
Next aCell
End If
End Sub
Any suggestions for emailing workbooks to ensure it works properly when received?