All checks were successful
NTFY Notification / notify (push) Successful in 20s
Rename VBA/ directory to VBA_BOMConverter/ for better clarity. This change reflects the module's purpose as the BOM converter component. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
37 lines
1.3 KiB
QBasic
37 lines
1.3 KiB
QBasic
' ==============================================================================
|
|
' 模块: M04_Config
|
|
' 职责: 系统配置、常量定义
|
|
' ==============================================================================
|
|
Option Explicit
|
|
|
|
' 源数据列号定义 (根据你的描述)
|
|
Public Const COL_IDX_CODE As Long = 3 ' 代号 (C列)
|
|
Public Const COL_IDX_NAME As Long = 4 ' 名称 (D列)
|
|
Public Const COL_IDX_QTY As Long = 5 ' 数量 (E列)
|
|
Public Const COL_IDX_COND As Long = 6 ' 选择条件 (F列)
|
|
Public Const COL_IDX_CAT As Long = 8 ' 类别 (H列)
|
|
Public Const SRC_START_ROW As Long = 4 ' 数据起始行
|
|
|
|
' 获取表头排序索引 (越小越靠前)
|
|
Public Function GetHeaderPriority(key As String) As Long
|
|
Dim vList As Variant
|
|
Dim i As Long
|
|
|
|
' 定义标准排序顺序
|
|
vList = Array("azxs", "bkxs", "gclj", "jycz", "lcdw", "lcfw", _
|
|
"fjgn", "btcy", "bp", "dskd", "nqlc", "bptx", _
|
|
"jddj", "cpdm", "tsjz", "tsyq", "bpts", "kdxh")
|
|
|
|
Dim sKey As String
|
|
sKey = LCase(Trim(key))
|
|
|
|
For i = LBound(vList) To UBound(vList)
|
|
If sKey = LCase(vList(i)) Then
|
|
GetHeaderPriority = i
|
|
Exit Function
|
|
End If
|
|
Next i
|
|
|
|
' 未知变量排在最后
|
|
GetHeaderPriority = 999
|
|
End Function |