Hello Friends,
I have a workbook in which there are multiple sheets. The workbook worked fine until last week when I added some userforms.
I have noticed the below issues.........
1) Sometimes worksheet activation does not get triggered for a specific sheet if called from another sheet within the workbook.
2) If the VBA editor is open then it does not get triggered at all for that specific sheet.
here is the worksheet activate code
called from this code
All errors are gone as soon as the userforms are removed from the file...
below is 1 of the 9 userforms I am using in the workbook
code used for this userform
Can someone pls shed some light on this as why this is happening ??
Regards,
Humayun
I have a workbook in which there are multiple sheets. The workbook worked fine until last week when I added some userforms.
I have noticed the below issues.........
1) Sometimes worksheet activation does not get triggered for a specific sheet if called from another sheet within the workbook.
2) If the VBA editor is open then it does not get triggered at all for that specific sheet.
here is the worksheet activate code
VBA Code:
Private Sub Worksheet_Activate()
ActiveSheet.Unprotect Password:="merchant"
Worksheets("CURRENT PRODUCTION STATUS").EnableCalculation = True
Range("A1", Range("A" & Rows.Count).End(xlUp)).AutoFilter 1, "1", , , 0
Range("A:T").Select 'set range zoom
ActiveWindow.Zoom = True
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Range("C24").ClearContents
Range("B7").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingRows:=True, Password:="merchant"
End Sub
called from this code
VBA Code:
Private Sub open_cps_from_ro()
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect Password:="2270166"
Sheets("CURRENT PRODUCTION STATUS").Visible = True
Worksheets("RUNNING ORDER STATUS").Cells(ActiveCell.Row, 1).Copy
Worksheets("CURRENT PRODUCTION STATUS").Range("B7").PasteSpecial Paste:=xlPasteValues
Sheets("RUNNING ORDER STATUS").Visible = xlSheetVeryHidden
ActiveWorkbook.Protect Password:="2270166", Structure:=True, Windows:=True
Application.ScreenUpdating = False
End Sub
All errors are gone as soon as the userforms are removed from the file...
below is 1 of the 9 userforms I am using in the workbook
code used for this userform
VBA Code:
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub quantity_value_list_Change()
Range("B4").Value = Me.quantity_value_list.Value
End Sub
Private Sub quantity_value_list_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Unload Me
End Sub
Private Sub UserForm_Initialize()
Me.quantity_value_list.Value = Range("B4").Value
End Sub
Can someone pls shed some light on this as why this is happening ??
Regards,
Humayun