タグ

ブックマーク / www2s.biglobe.ne.jp/~iryo (2)

  • VBA変数

    4.変数と定数 4ー1変数と定数の宣言方法 Const fil1 As String = "c:\4月PKG.xls" '定数の例 Public Const dva As String = "b:" '共通定数 ' Dim aaa As Integer '整数型 Public xxx As Integer '整数型(共通の場合) Dim bbb As Long '長整数型 Dim ccc As Single '単精度浮動小数点数型 Dim ddd As Double '倍精度浮動小数点数型 Dim eee As String '文字列型 Dim fff As Date '日付型 Dim ggg As Currency '通貨型 Dim hhh As Object '任意の型のオブジェクト Dim iii As Variant 'バリアント型 Dim jjj

  • VBAブック制御

    3.ブック・シートの制御 3ー1ブックをチェックしオープン又はアクティブ化 Const fil2 As String = "b:\VBA雑\小文字.xls" Const fil2a As String = "小文字.xls" Sub 例31() fila = 0 For Each file_name In Windows If file_name.Caption = fil2a Then Windows(fil2a).Activate fila = 1 End If Next If fila = 0 Then Workbooks.Open Filename:=fil2 End If End Sub ・このプログラムでは定数を使用しファイル名を入れているが、システムに合わせ変更する。 ・Fore EachでExcelでオープンされているウインドウを調べ

  • 1