forecast_api/Master Template.xlsm_EXPORTS/openf.frm
PhilRunninger b10a3ac655 Add a function to treat 1x1 ranges as an array, not a scalar value.
The Range.Value function does not consistently return a 2-D array. If
the range is a single cell, it returns just the value in that cell. When
initializing a Userform listbox, it needs to be an array, so this
function was born.
2024-03-15 10:09:56 -04:00

65 lines
1.8 KiB
Plaintext

VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} openf
Caption = "Open a Forecast"
ClientHeight = 2400
ClientLeft = 120
ClientTop = 465
ClientWidth = 8220.001
OleObjectBlob = "openf.frx":0000
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "openf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cbCancel_Click()
openf.Hide
End Sub
Private Sub cbOK_Click()
If opDSM.Value Then
Call handler.pg_main_workset("quota_rep_descr", cbDSM.Value)
ElseIf opDirector.Value Then
Call handler.pg_main_workset("director", cbDirector.Value)
ElseIf opSegment.Value Then
Call handler.pg_main_workset("segm", cbSegment.Value)
End If
shOrders.PivotTables("ptOrders").PivotCache.Refresh
openf.Hide
End Sub
Private Sub cbOK_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 2 And Shift = 2 Then
shConfig.Range("debug_mode") = Not shConfig.Range("debug_mode")
End If
End Sub
Private Sub opDSM_Click()
cbDSM.Visible = True
cbDirector.Visible = False
cbSegment.Visible = False
End Sub
Private Sub opDirector_Click()
cbDSM.Visible = False
cbDirector.Visible = True
cbSegment.Visible = False
End Sub
Private Sub opSegment_Click()
cbDSM.Visible = False
cbDirector.Visible = False
cbSegment.Visible = True
End Sub
Private Sub UserForm_Activate()
handler.server = shConfig.Range("server").Value
cbDSM.list = RangeToArray(shSupportingData.ListObjects("DSM").DataBodyRange)
cbDirector.list = RangeToArray(shConfig.ListObjects("DIRECTORS").DataBodyRange)
cbSegment.list = RangeToArray(shConfig.ListObjects("SEGMENTS").DataBodyRange)
End Sub