回答編集履歴
1
オーバーロードを使う方法を追記
test
CHANGED
@@ -54,3 +54,29 @@
|
|
54
54
|
End If
|
55
55
|
Next
|
56
56
|
```
|
57
|
+
|
58
|
+
### 追記
|
59
|
+
単純に、オーバーロード関数を作るのもいいいかもしれません。
|
60
|
+
|
61
|
+
```vb.net
|
62
|
+
Sub inputExcelData(ByRef Item As Integer?, Cells As String)
|
63
|
+
Item = XlsxCreator.Cell(Cells).GetInteger
|
64
|
+
End Sub
|
65
|
+
Sub inputExcelData(ByRef Item As String, Cells As String)
|
66
|
+
Item = XlsxCreator.Cell(Cells).Str
|
67
|
+
End Sub
|
68
|
+
Sub inputExcelData(ByRef Item As Date?, Cells As String)
|
69
|
+
Item = XlsxCreator.Cell(Cells).GetDate
|
70
|
+
End Sub
|
71
|
+
Sub inputExcelData(ByRef Item As Decimal?, Cells As String)
|
72
|
+
Item = XlsxCreator.Cell(Cells).GetDecimal
|
73
|
+
End Sub
|
74
|
+
```
|
75
|
+
使い方
|
76
|
+
```vb.net
|
77
|
+
inputExcelData(model.数字, "H4")
|
78
|
+
inputExcelData(model.文字, "J4")
|
79
|
+
inputExcelData(model.日付, "K4")
|
80
|
+
inputExcelData(model.小数, "E7")
|
81
|
+
```
|
82
|
+
|