advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 2419 for ピボットテーブル (0.004 sec.)
[[20141009100633]]
#score: 4766
@digest: 0ac1287e1b1c46970a23c671ba272ac4
@id: 66321
@mdate: 2014-10-09T05:36:58Z
@size: 7163
@type: text/plain
#keywords: pivottables (50879), showtablestylecolumnstripes (38104), 庫") (33206), showtablestylerowstripes (30483), subtotals (29340), pivotfields (25522), 庫一 (17495), ル1 (16691), xlrowfield (13260), 庫", (13081), ピボ (12181), トテ (12004), xlcount (9419), xlpivottableversion14 (9243), position (8776), adddatafield (8690), 庫" (7911), 数/ (7013), ーブ (6946), テー (6756), false (6359), activesheet (6038), 所") (5900), ボッ (5660), 入庫 (5405), ブル (5211), freezepanes (4992), 管場 (4905), 付") (4793), 号") (4709), 在庫 (4698), 覧! (4577)
『マクロでのピボットの作成』(初心者)
お世話になります。 下記コードを書いたマクロブックを別のコマンドで開け、 別のシステムからダウンロードしたばかりの「在庫一覧」というエクセルファイルを 加工し、ピボットテーブルを作成したいのですが・・・ 下記、 ActiveSheet.Cells(1, 9).Selectというところで rangeクラスのselectメソッドが失敗しました(エラー1004)となってしまいます。 原因は何でしょうか? Private Sub Workbook_Open() With Workbooks.Open(CreateObject("WScript.Shell").SpecialFolders("DeskTop") & "¥在庫一覧.xlsx").Sheets("在庫一覧") Columns("A:Y").Select Columns("A:Y").Select Selection.ColumnWidth = 12 Columns("A:Y").EntireColumn.AutoFit Columns("A:Y").EntireColumn.AutoFit Cells.EntireColumn.AutoFit Application.Goto Reference:="R1C9" ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "在庫一覧!R1C1:R1894C8", Version:=xlPivotTableVersion14).CreatePivotTable _ TableDestination:="在庫一覧!R1C9", TableName:="ピボットテーブル1", DefaultVersion _ :=xlPivotTableVersion14 ActiveSheet.Cells(1, 9).Select With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("日付") .Orientation = xlColumnField .Position = 1 End With With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("部品番号") .Orientation = xlRowField .Position = 1 End With With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("保管場所") .Orientation = xlRowField .Position = 2 End With With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("入庫") .Orientation = xlRowField .Position = 3 End With ActiveSheet.PivotTables("ピボットテーブル1").AddDataField ActiveSheet.PivotTables( _ "ピボットテーブル1").PivotFields("入庫"), "データの個数 / 入庫", xlCount With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("データの個数 / 入庫") .Caption = "合計 / 入庫" .Function = xlSum End With With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("出庫") .Orientation = xlRowField .Position = 3 End With ActiveSheet.PivotTables("ピボットテーブル1").AddDataField ActiveSheet.PivotTables( _ "ピボットテーブル1").PivotFields("出庫"), "データの個数 / 出庫", xlCount With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("データの個数 / 出庫") .Caption = "合計 / 出庫" .Function = xlSum End With With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("在庫") .Orientation = xlRowField .Position = 3 End With ActiveSheet.PivotTables("ピボットテーブル1").AddDataField ActiveSheet.PivotTables( _ "ピボットテーブル1").PivotFields("在庫"), "データの個数 / 在庫", xlCount With ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("データの個数 / 在庫") .Caption = "合計 / 在庫" .Function = xlSum End With ActiveWorkbook.ShowPivotTableFieldList = False ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleColumnStripes = True ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleColumnStripes = False ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleRowStripes = True ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleRowStripes = False ActiveSheet.PivotTables("ピボットテーブル1").TableStyle2 = "PivotStyleMedium1" ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleColumnStripes = True ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("摘要").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("日付").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("保管場所").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("部品番号").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("XHEAD 2::NAME").Subtotals _ = Array(False, False, False, False, False, False, False, False, False, False, False, False _ ) ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("入庫").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("出庫").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("ピボットテーブル1").PivotFields("在庫").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) Cells.Find(What:="全体の合計 / 在庫", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, MatchByte:=False, SearchFormat:=False).Activate Cells.Find(What:="全体の合計", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, MatchByte:=False, SearchFormat:=False).Activate Range("R6").Select ActiveWindow.SmallScroll Down:=64 Application.WindowState = xlNormal ActiveWindow.SmallScroll Down:=-32 Range("J42").Select Range("J4").Select With ActiveWindow .SplitColumn = 0 .SplitRow = 1 End With ActiveWindow.FreezePanes = True Columns("A:H").Select Range("H1").Activate Selection.EntireColumn.Hidden = True Application.Width = 959 Application.Height = 504.5 ActiveWindow.FreezePanes = True Application.ScreenUpdating = True Dim Filename As String Filename = Format(Date, "yymmdd") & ".xlsx" ActiveWorkbook.SaveAs "C ¥Desktop¥在庫一覧" & Filename ActiveWorkbook.Close End With End Sub < 使用 Excel:Excel2010、使用 OS:Windows7 > ---- 見た感じ使っていないようなので、その行を削除して問題あるでしょうか。 Pivot を作成した位置として指定しているようなので、作成後に選択する必要は ないと思うのですが。 (Mook) 2014/10/09(木) 12:58 ---- マクロの記録使って作成したのですよね? フィールドリストを見る為にそこをクリックしたのだと思いますのでMookさんのおっしゃるとおり必要なさそうです >ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleColumnStripes = True >ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleColumnStripes = False >ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleRowStripes = True >ActiveSheet.PivotTables("ピボットテーブル1").ShowTableStyleRowStripes = False ここも特に必要なさそうですが… (ちなみにピボットテーブルをVBAで扱うのは、Tasanさんの「雨のち晴れ」サイトがおすすめです) これは私見ですが、ピボットにする必要が特になく結果だけ表示できればいいのであれば、元データからVBAで作った方が楽ですし、メンテしやすいです (まお) 2014/10/09(木) 14:36 ...
http://www.excel.studio-kazu.jp/wiki/kazuwiki/201410/20141009100633.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 96999 documents and 607826 words.

訪問者:カウンタValid HTML 4.01 Transitional