Excel VBA 質問スレ Part76at TECH
Excel VBA 質問スレ Part76 - 暇つぶし2ch507:デフォルトの名無しさん
22/06/14 10:48:30.78 WigeF4Tr0.net
>>498
若干無理矢理だけどクラス使えば似たような事は出来る
Type1.cls
Private Zip_ As String * 7
Private telnum_ As String * 11
Public Property Let Default(N As String)
Zip_ = Left(N, 7)
telnum = Mid(N, 8)
End Property
Public Property Get Zip()
Zip = Zip_
End Property
Public Property Get telnum()
telnum = telnum_
End Property
デフォルトプロパティの設定がちょっとトリッキー、こことかを参考に
URLリンク(thom.hateblo.jp)
あとは
Dim a As New Type1
a = "151123408012341234"
Debug.Print a.Zip
Debug.Print a.telnum


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch