Inside File 1, if the user types "NEW" into Column B...I want File 2 to open in the background. It pops open a user form to get information from the user. Works fine.
Whenever I want another user to edit File 2, upon opening, it is always hidden. How can I address that?
Here is the coding that is in File 1 that closes the hidden File 2.
Whenever I want another user to edit File 2, upon opening, it is always hidden. How can I address that?
VBA Code:
'Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
If Not Intersect(Target, Range("B10:B500")) Is Nothing Then
If Target.Rows.count > 1 Or Target.Columns.count > 1 Then
'nothing
Else
If InStr(1, Target.Value, "New", 1) > 0 Then
If CheckFileIsOpen("File 2.xlsm") = False Then
'On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Workbooks.Open ("S:\File 2.xlsm")
Windows("File 2.xlsm").Visible = False
'On Error GoTo 0
End If
NewRMsBox.Show
End If
End If
End If
Here is the coding that is in File 1 that closes the hidden File 2.
VBA Code:
'***Private Sub Workbook_BeforeClose(Cancel As Boolean)
'
If CheckFileIsOpen("File 2.xlsm") = True Then
On Error Resume Next
Workbooks("S:\File 2.xlsm").Save
Workbooks("S:\File 2.xlsm").Close
On Error GoTo 0
End If
Application.DisplayAlerts = False
If ThisWorkbook.ReadOnly Then
ThisWorkbook.Close savechanges:=False
End If
Application.DisplayAlerts = True
'End Sub