Public d_出荷元一覧 As Object
Function f_列位置設定_出荷元一覧()
Dim j As Integer Dim w_str As String
Set d_出荷元一覧 = CreateObject("Scripting.Dictionary") With s0b_出荷元一覧
For j = 1 To .Cells.SpecialCells(xlCellTypeLastCell).Column If .Cells(1, j).Value <> "" Then d_出荷元一覧.Add Replace(CStr(.Cells(1, j).Value), vbLf, ""), .Cells(1, j).Column End If Next j For j = 1 To .Cells.SpecialCells(xlCellTypeLastCell).Column If .Cells(1, j).Value <> "" Then w_str = .Cells(1, j).Value End If If .Cells(2, j).Value <> "" Then d_出荷元一覧.Add w_str & Replace(CStr(.Cells(2, j).Value), vbLf, ""), .Cells(2, j).Column End If Next j End With
' Dim key As Variant' Debug.Print "------------------------------"' Debug.Print "d_出荷元一覧"' For Each key In d_出荷元一覧.Keys' Debug.Print d_出荷元一覧(key) & vbTab & key' Next key' Debug.Print "------------------------------"
End Function