![]() |
| サイトマップ | |
|
トップ | オブジェクト | プロパティ | メソッド | 定数 |
IsCurrentItem プロパティ |
オブジェクト:ExcelItem, FitItem, GraphItem, MacroItem, NativeWorksheetItem, NotebookItem, ReportItem, TransformItem
指定したアイテムが現在選択状態にあるアイテムか否かを返します。このプロパティは、特に CurrentItem プロパティと併せて使うと便利です。
Dim NotebookItems$() ReDim NotebookItems$(ActiveDocument.NotebookItems.Count) Dim Index Index = 0 Dim index2 index2=0 Dim DataList$(ActiveDocument.NotebookItems.Count) Dim Item For Each Item In ActiveDocument.NotebookItems If ActiveDocument.NotebookItems(Index).IsOpen=True Then If ActiveDocument.NotebookItems(Index).ItemType = 1 Or ActiveDocument.NotebookItems(Index).ItemType = 8 Then DataList$(Index2) = ActiveDocument.NotebookItems(Index).Name index2=index2+1 ActiveDocument.NotebookItems(Index).Open End If End If Index = Index + 1 Next Item Begin Dialog UserDialog 320,119,"Open Worksheets in Active Notebook" ' %GRID:10,7,1,1 OKButton 210,14,90,21 ListBox 20,14,170,91,DataList(),.ListBox1 End Dialog Dim dlg1 As UserDialog Dialog dlg1 ActiveDocument.NotebookItems(DataList$(dlg1.ListBox1)).IsCurrentItem = True Dim sourcecol As String sourcecol=InputBox$("Which column do you want to copy?","Source Column","1") Dim MaxColumn As Long Dim MaxRows As Long MaxColumn = 0 MaxRows = 0 ActiveDocument.NotebookItems(DataList$(dlg1.ListBox1)).DataTable.GetMaxUsedSize(MaxColumn,MaxRows) Dim Column1() As Variant Column1()=ActiveDocument.CurrentDataItem.DataTable.GetData(CLng(sourcecol)-1,0,CLng(sourcecol)-1,MaxRows-1) Begin Dialog UserDialog 320,119,"Target Worksheets" ' %GRID:10,7,1,1 OKButton 210,14,90,21 ListBox 20,14,170,91,DataList(),.ListBox1 End Dialog Dim dlg2 As UserDialog Dialog dlg2 ActiveDocument.NotebookItems(DataList$(dlg2.ListBox1)).IsCurrentItem = True ActiveDocument.CurrentItem.Open sourcecol=InputBox$("In which column do you want to place the data?","Source Column","1") ActiveDocument.CurrentDataItem.DataTable.PutData(Column1,CLng(sourcecol)-1,0)