Riverside Learning LABO(Skill/Idea/Code)

よりよいシステムのため工学系と人間系の学習下書きメモ

ExcelVBA

ExcelVBAポケットリファレンス
著者:前田知美

Excel97/2000/2002/2003/2007対応
存在する機能をさっと見るには便利です。
メソッド、プロパティ、ステートメント抜粋。
名称通りの使い方だがわからないときはすぐチェック。
できることを知る。

□目次
1.基本文法
2.セル
3.ワークシート
4.ブック
5.条件付き書式
6.集計・並べ替え
7.データ抽出
8.データベース
9.データ関連
10.色
11.フォント
12.文字列操作
13.日付・時刻
14.配列
15.コントロール
16.イベント
17.ウィンドウ
18.グラフ
19.ピボットテーブル・ピボットグラフ
20.ファイル操作
21.印刷
22.エラー処理

メソッド、プロパティ、ステートメント抜粋(2007のみ対応は省略)

1.基本文法
Dim,Private,Public,Static,Set,Type,
If,Select,Do,For,Exit,With

2.セル
Range,ActiveCell,Cells,Previous,Next,OffSet,
Row,Column,EntireRow,EntireColumn,
Union,Areas,Activate,Select,SpecialCells,Value,Text,
Formula,FormuLaLoval,FormuLaR1C1,FormuLaR1C1Loval,
Copy,Cut,Paste,PasteSpecial,
MoveAfterReturn,MoveAfterReturnDirection,CutCopyMode,
Insert,Delete,Address,AddressLocal,MergeCells,
Name,NumberFormat,NumberFormatLocal,EditDirectryInCell,
DisplayFormula,FourmulaHidden,Hidden,
Left,Top,Column,Row,RowHeight,ColumnWidth,
VerticalAlignment,HorizontalAlignment,WrapText,
Count,Clear,ClearContents,ClearFormats,
Add,Delete,Name,RangeSelection,Locked,
Validation,BorderAround,AutoFormat,FindFormat,
Find,FindNext,FindPrevious,Replace,AutoFill,
LineStyle,Weight,Add

3.ワークシート
Activate,Select,Previous,Next,
Name,Count,Add,Delete,Copy,SaveAs,ExportAsFixedFormat
ScrollArea,EnableCalculation,Protect,Unprotect,ProtectContents
Index,WorksheetFunction,Visible,Move,DisplayWorkBookTabs,
Hidden,DisplayHeadings,Insert,Delete,
RowHeight,ColumnWidth,UseStandardHeight,
UseStandardWidth,StandardHeight,StandardWidth,
ListObject,Add,Delete,Range,Value

4.ブック
Add,Activate,Open,Close,Name,SaveAs,Save
Select,Previous,Next

5.条件付き書式
Add,FormatCondition,Count,Type,
Operator,Formula1,Formula2,Modify,Delete,Trim

6.集計・並べ替え
Subtotal,RemoveSubtotal,ShowLevels,Sorts,ClearOutLine

7.データ抽出
Switch,AdvancedFilter,Chooes

8.データベース
Open(ADO),Connection(ADO),RecordSet(ADO),
Value,Field,MoveFirst,MoveLast,MoveNext,MovePrevious,
Close(ADO),Connection(ADO),RecordSet(ADO)

9.データ関連
CBool,CByte,CCur,CDate,CDbl,CDec,CInt,CLng,CSng,CStr,CVar,
Val,Str,Str$,IsArray,IsDate,IsNumeric,IsEmpty,IsNull,IsObject,IsMising

10.色
ColorIndex,Color,Colors,Tab,InvertIfNegative,SchemeColor,RGB,
MarkerForegroundColor,MarkerForegroundColorIndex,
MarkerBackgroundColor,MarkerBackgroundColorIndex,

11.フォント
Name,Size,Italic,Bold,FontStyle,UnderLine,Strikethrough,
Characters,Superscript,Subscript

12.文字列操作
Len,LenB,LCase,UCase,StrConv,Left.Left$,LeftB,LeftB$,
Right.Right$,RightB,RightB$,Mid,Mid$,MidB,MidB$,
StrComp,InStr,InStrB,InStrRev,Space,Trim,Trim$,LTrim,LTrim$,RTrim,RTrim$,
String,String$,Rset,LSet,Chr,Chr$,ChrB,ChrB$,ChrW,ChrW$,
Asc,AscB,AscW,Fix,Int,Hex,Hex$,Oct,Oct$,Format,Format$,FormatDateTime,
FormatCurrency,FormatNumber,FormatPercent,Format,Format$,Option Compare

13.日付・時刻
Year,Month,Day,Hour,Minute,Second,WeekDay,WeekDayName,
Date,Date$,Time,Time$,Now,Timer,DataValue,TimeValue,
DateSerial,TimeSerial,DataDiff,DataPart,DataAdd,

14.配列
Dim,Redim,Join,Split,Array,Erase,Option Base,UBound,LBound,

15.コントロール
Label,Caption,ListBox,RowSource,ListBox,ColumnCount,RefEdit,
TabStop,TabIndex,Tag,Item,Controls,IMEMode,AutoTab,PasswordChar,

16.イベント
Book,Application,Chart,WorkSheetごとにイベント有り
リストに出るので省略

17.ウィンドウ
NewWindow,Close,Activate,ScrollRow,ScrollColomn,
ActivatePrevious,ActivateNext,Height,Width,EnableResize,Top,Left,
WindowState,Split,SplitRow,SplitColumn,SplitHorizontal,SplitVertical,
FreezePanes,DisplayZeros,Arrange,ScrollWorkBookTabs,SmallScroll,LargeScroll,Visible

18.グラフ
Activate,Select,Add,Extend,ChartType,SetSourceData,ChartWizard,ClearFormats,
VaryByCategories,MarkerSize,MarkerStyle,Left,Top,Height,Width,
BringtoFront,SendToBack,HasTitle,Text,HasDateTable,HasDateLabel,HasDateLabels,
HasLegend,ShowLegendKey,SplitType,SplitValue,HasSeriesLine,HasDropLines,
HasHiLoLines,HasUpDownBars,SecondPlotSize,HasAxis,AxisGroup,CategoryNames,
MajorTickMark,MinorTickMark,HasMajorGridLines,HasMinerGridLines,
MajorUnit,MinorUnit,MaximumScale,MinimumScale,TickLabelPosition,
Category Type,BaseUnit,BaseUnitIsAuto,DisplayUnit,DisplayUnitCustom,
MajorUnitScale,Perspective,Elevation,Rotation

19.ピボットテーブル・ピボットグラフ
PivotTableWizard,RefreshTable,RefreshDate,CurrentPage,
RowGrand,ColumnGrand,Orientation,ColumnWidth,DataRange,Position,
AddFields,Delete,AddDataField,Delete

20.ファイル操作
OpenText,FileCopy,Name,DefaultFilePath,ChrDrive,CurDir,ChDir,MKDir,RmDir,Dir,
GetAttr,SetAttr,FileDateTime,Quit,DisplayAlerts.Saved

21.印刷
PrintOut,ActivePrinter,PrintPreview,Orientation,PaperSize,TopMergin,CemtimetersToPoints,
PrintArea,Zoom,PrintHeadings,LeftHeader,CenterHeader,RightHeader,
LeftFooter,CenterFooter,RightFooter,FitToPagesTall,FitToPagesWide,
BottomMergin,TopMergin,LeftMergin,RightMergin

22.エラー処理
Number,On Error Resume Next,On Error GoTo ,On Error GoTo 0,Description,CVErr,Error,Error$,IsError

よく使うコードはまとめてみよう。