DÙNG VBA ĐIỀU KHIỂN PIVOT TABLE ĐỂ TẠO BÁO CÁO

Điều khiển các chức năng cơ bản và nâng cao: 1. Hoán đổi vị trí các fields trong cùng Area PHP Code: With ("") .PivotFields("").Position = IIf(.Position = 1, 2, 1) ' Dời Row field qua trái hoặc Column Field lên trên:' .PivotFields("").Position = .Position - 1 ' Dời Row field qua phải hoặc Column Field xuống dưới:' .PivotFields("").Position = .Position + 1 End With 2. Chuyển vị trí fields từ Area này qua Area khác PHP Code: With ("") .PivotFields("").Orientation = xlRowField 'Row Area' .PivotFields("").Orientation = xlColumnField 'Column Area' .PivotFields("").Orientation = xlPageField 'Page Area' End With 3. Thêm & thay đổi dữ liệu cần phần tích trong Data Area PHP Code: With. | DÙNG VBA ĐIỀU KHIỂN PIVOT TABLE ĐỂ TẠO BÁO CÁO I. Điều khiển các chức năng cơ bản và nâng cao 1. Hoán đổi vị trí các fields trong cùng Area PHP Code With PivotTableName .PivotFields FieldName .Position IIf .Position 1 2 1 Dời Row field qua trái hoặc Column Field lên trên .PivotFields FieldName1 .Position .Position - 1 Dời Row field qua phải hoặc Column Field xuống dưới .PivotFields FieldName2 .Position .Position 1 End With 2. Chuyển vị trí fields từ Area này qua Area khác PHP Code With PivotTableName .PivotFields FieldName1 .Orientation xlRowField Row Area .PivotFields FieldName2 .Orientation xlColumnField Column Area .PivotFields FieldName3 .Orientation xlPageField Page Area End With 3. Thêm thay đổi dữ liệu cần phần tích trong Data Area PHP Code With PivotTableName .PivotFields Alias of FieldName1 .Orientation xlHidden gỡ field ra kh ỏi Data Area .AddDataField PivotTableName .PivotFields FieldName2 _ Alias of FieldName2 xlSum xlMax xlMin . Thêm field vào Data Ar ea End With 4. Show - Hide GrandTotal PHP Code With PivotTable 1 .RowGrand True False .ColumnGrand True False End With 5. Filter single selection PHP Code PivotTableName .PivotFields FieldName .Cur rentPage FieldItem 6. Filter Multiple selection

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.