|
※行数削除の為 Noと名前のみになっておりますが、Publicの数だけデータがあります。
'========================================================
'標準モジュール
Public No As Long
Public 名前 As String
Public レベル As Long
Public 貢献度 As Long
Public In率 As String
Public 最大戦闘力 As Long
Public 新規登録日 As String
Public 最終更新日 As String
Public 備考 As String
Public CNT1 As Long
Public CNT2 As Long
Public CNT3 As Long
Public LastCNT1 As Long
Public LastCNT2 As Long
Public WS1 As Worksheet
Option Explicit
'-------------------------------------------------------------------
Sub auto_open()
Call 初期処理
団員一覧.Show
End Sub
Sub 初期処理()
Set WS1 = ThisWorkbook.Worksheets("団員一覧")
With 団員一覧.ListView1
.View = lvwReport ''表示
.LabelEdit = lvwManual ''ラベルの編集
.HideSelection = False ''選択の自動解除
.AllowColumnReorder = True ''列幅の変更を許可
.FullRowSelect = True ''行全体を選択
.Gridlines = True ''グリッド線
'列見出し
.ColumnHeaders.Add , "No", "No", 50
.ColumnHeaders.Add , "名前", "名前", 50
End With
End Sub
Sub 団員一覧表示処理()
LastCNT1 = WS1.Cells(Rows.Count, 1).End(xlUp).Row
CNT1 = 2
団員一覧.ListView1.ListItems.Clear
For CNT2 = 1 To 99
If CNT1 <= LastCNT1 Then
If Cells(CNT1, 2) = "" Then
GoTo 10
Else
Call 団員一覧書込処理
CNT1 = CNT1 + 1
End If
Else
GoTo 10
End If
Next
10
End Sub
Sub 団員一覧書込処理()
With 団員一覧.ListView1.ListItems.Item
.Text = Cells(CNT1, 1)
.SubItems(1) = Cells(CNT1, 2)
End With
End Sub
Sub 団員登録表示処理()
With 団員登録
.TextBox1 = No
.TextBox2 = 名前
End With
End Sub
Sub 団員登録更新処理()
With 団員登録
No = .TextBox1
名前 = .TextBox2
End With
With 団員一覧.ListView1.ListItem
.Text = No
.SubItems(1) = 名前
End With
End Sub
Sub 更新チェック()
'未着手
End Sub
'========================================================
'団員一覧フォーム
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub CommandButton3_Click()
Call 団員一覧表示処理
End Sub
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
No = Item
名前 = Item.SubItems(1)
Call 団員登録表示処理
団員登録.Show
End Sub
'========================================================
'団員登録フォーム
Private Sub CommandButton2_Click()
' Call 更新チェック
Unload Me
End Sub
Private Sub CommandButton3_Click()
Call 団員登録更新処理
End Sub
Private Sub TextBox7_Change()
TextBox7.Locked = True
End Sub
'========================================================
|
|