Excel VBA プロパティのコードを生成する
ナビゲーションに移動
検索に移動
Excel VBA プロパティのコードを生成する
[[Excel VBA][Python]]
- Excel VBA プロパティのコードを生成するPythonスクリプト
# -*- coding: utf-8 -*- def make_vba_properties(): fields = ['aaa','bbb','ccc'] comments = ['AAA','BBB','CCC'] for i in range(len(fields)): print 'Private m_%s\t\t\tAs String\t\' %s' % (fields[i], comments[i]) for i in range(len(fields)): print '\ print '\' %s' % (comments[i]) print '\ print 'Public Property Get %s() As String' % (fields[i]) print '\t%s = m_%s' % (fields[i], fields[i]) print 'End Property' print '\ print '\' %s' % (comments[i]) print '\ print 'Public Property Let %s(ByVal %s As String)' % (fields[i], fields[i]) print '\tm_%s = %s' % (fields[i], fields[i]) print 'End Property' if __name__ == '__main__': make_vba_properties()
© 2006 矢木浩人