Create Pivot table with VBA Macro

Create Pivot table with VBA Macro

Training by Himanshu

7 лет назад

29,154 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@sakib0072
@sakib0072 - 02.04.2018 23:20

Thanks ! Clean n helpful 😎😎😎

Ответить
@rakshyit
@rakshyit - 16.02.2024 14:33

Thank you for such a nice explanation. I have a small query. As per the code mentioned by you, I am able to create pivot table, but if I want that table to be sorted in descending order, then how. I tried but it's not working. below is my code.
Dim datepivot As PivotTable
Dim datecache As PivotCache
Sheet2.Activate
Set datecache = ActiveWorkbook.PivotCaches.Create(xlDatabase, Range("A2").CurrentRegion)
Set datepivot = ActiveSheet.PivotTables.Add(datecache, Range("b2"), "Mypivot1")
datepivot.PivotFields("Date").Orientation = xlRowField datepivot.PivotFields("Net Premium").Orientation = xlDataField
datepivot.PivotFields("Net Premium").AutoSort Order:=xlDescending, Field:="Net Premium"

Last line is the sorting thing, it's not throwing any error, but also not sorting.

Please help.

Ответить
@chhinuchhuria9347
@chhinuchhuria9347 - 20.12.2023 20:41

Thanks sir

Ответить
@deb1995
@deb1995 - 01.12.2023 07:41

it is showing as compile error : variable not defined in the sub trail_pivot12() line

Ответить
@merugubhanu3334
@merugubhanu3334 - 24.07.2023 18:10

I wanted to create the data in specific worksheet how can we do that

Ответить
@ggkjghkjh
@ggkjghkjh - 21.07.2023 12:35

What is the value to be used for filter. Its good that you have mentioned about the row column and data but i need the filter data as well

Ответить
@shimonatiwari9954
@shimonatiwari9954 - 22.04.2023 23:40

Hi, this is the best and easy pivot option I have ever seen..just want your little help I want to add a command of sorting the data from largest to smallest number in pivot..is that possible?

Ответить
@sheharyarch6317
@sheharyarch6317 - 27.12.2022 06:40

Clean n Helpful. Thanks You

Ответить
@arsidagamer
@arsidagamer - 28.06.2022 07:16

How can i do max of items instead of sum in the same code?

Ответить
@srivatsaniyer8948
@srivatsaniyer8948 - 14.05.2022 11:09

How to add more pivots in same worksheet

Ответить
@1431jagan
@1431jagan - 19.04.2022 18:02

Hi Himanshu i tried using same code in VBA it is showing error as "Invalid procedure call or Argument"

Ответить
@Ramyadav-tv1rz
@Ramyadav-tv1rz - 09.04.2022 12:08

Really very nice and useful. Thanks you very much for such video !

Ответить
@paddyp8546
@paddyp8546 - 27.10.2021 10:36

Showing error at Set mycache line

Ответить
@giteshbhoir9086
@giteshbhoir9086 - 19.10.2021 16:00

Thank you !! helpful

Ответить
@velperumal6986
@velperumal6986 - 18.09.2021 18:50

HI Bro, Run Time Error 1004 'Unable to get the PivotFields property of the PivotTable class', How to fix this error

Ответить
@makwanamanoj8584
@makwanamanoj8584 - 08.09.2021 08:25

Really helpful...nice and best content

Ответить
@ganeshgaikwad8810
@ganeshgaikwad8810 - 05.08.2021 17:32

Hi sir i want to know how to change the value like sum or count in xldatafield

Ответить
@mehboobmaniyar1890
@mehboobmaniyar1890 - 22.06.2021 12:44

Really nice explanation

Ответить
@PP-dv5gf
@PP-dv5gf - 19.06.2021 13:51

Brother,

Can I have your number.Please.

Ответить
@nehakharche6752
@nehakharche6752 - 04.06.2021 10:46

Getting 1004 error we can't change this part of the pivot table

Ответить
@shivkumar3435
@shivkumar3435 - 03.06.2021 05:53

Kya age factor h Vba me job ke liye. 30 ke par wale ke liye h.

Ответить
@anandusolanki
@anandusolanki - 19.03.2021 15:38

Each step of VBA Macro has been present perfectly. Nice Teaching methodology. it really help me a lot.

Ответить
@neetshil1434
@neetshil1434 - 05.02.2021 15:42

greate explanation.. its helpful

Ответить
@gsc221315
@gsc221315 - 04.02.2021 12:06

The code is running fine in Module but not in Command Button ..why so ?

Ответить
@manaswinisahoo4555
@manaswinisahoo4555 - 22.12.2020 17:00

I m your new subscriber
Very helpful vdo

Ответить
@user-ix9hb7je4lGaurav
@user-ix9hb7je4lGaurav - 17.12.2020 18:36

It’s showing me mismatch 13 error

Ответить
@shaikhaziz9703
@shaikhaziz9703 - 28.11.2020 04:43

Dear Sir, Please help me to find out below solution,

what if i want to start my pivot table from second row because first row is merged i want to start my pivot from second row..according to your code i have tried to changed mycache range from ("A1") to ("A2")...it's not working...please help

Ответить
@indiangraphics1111
@indiangraphics1111 - 27.10.2020 10:56

fantastic job bro

Ответить
@aroraankit873
@aroraankit873 - 08.09.2020 21:31

Getting Run-Time error 1004 unable to get the current region property of the range class

Ответить
@sunilchapra1044
@sunilchapra1044 - 11.08.2020 18:05

Thanks for this video, this video is easy to learn and understand micro.

Ответить
@abhishekkommera8965
@abhishekkommera8965 - 30.07.2020 09:31

getting error type mismatch "13" in set mycache

Ответить
@tarunsingh7107
@tarunsingh7107 - 14.07.2020 18:21

It is giving error of type match in mycatche pls help

Ответить
@chanchaldas6229
@chanchaldas6229 - 11.07.2020 06:33

Thanks bro.
Awesome.

Ответить
@rakeshjoshi766
@rakeshjoshi766 - 09.07.2020 16:23

Hello, when i am using this code i am unable to do create pivot table, just adding a sheet after run the macro. Plz suggest.

Ответить
@swaroopsinha9648
@swaroopsinha9648 - 30.05.2020 16:55

Sir, first of all thank you for sharing this, I have went through many video on this topic but your video was really simple but exactly what anyone can learn,, simply amazing,, sir if you teaching macro then I would love to learn please let me know.. And also can you help me with putting filter on the pivot i.e. above to the xlrow.. Many thanks sir

Ответить
@sandyk3264
@sandyk3264 - 20.05.2020 21:00

Is it pssbl to filter only one item, ignoring other. Being evertime i need to shoose same filtr but other keep changing. So, if i mention them in vba it will give error nxt time.

Ответить
@satishchaurasia84ya
@satishchaurasia84ya - 05.04.2020 22:02

Woow perfect nice way of teaching. Thank you so much keep it up

Ответить
@sanjeevsingh1489
@sanjeevsingh1489 - 27.12.2019 21:43

Thanks

Ответить
@sanjaynoudiyal9467
@sanjaynoudiyal9467 - 17.11.2019 09:45

Perfect sir. I needed it.. Finally you have done my query... Thanks a lot..

Ответить
@faltooo3446
@faltooo3446 - 25.09.2019 13:29

CODE NOT WORK PROPERLY .

Ответить
@shreeyasingh6359
@shreeyasingh6359 - 16.05.2019 12:35

Can you please mention the syntax for creating pivot in an existing sheet

Ответить
@ghazikhan3133
@ghazikhan3133 - 21.03.2019 16:50

How to code it if you want to create the pivot in existing sheet?

Ответить
@sureshjogi9626
@sureshjogi9626 - 29.01.2019 19:32

very good explanation and useful for learning VBA users and thanks

Ответить
@AshwaniKumarshakya
@AshwaniKumarshakya - 11.05.2018 15:29

Code not working in another file
Repeated in same file

Ответить
@allaboutvideos5472
@allaboutvideos5472 - 18.03.2018 17:30

Nicely explained☺

Ответить
@nileshghanate3377
@nileshghanate3377 - 05.02.2018 12:05

Very nice video.. Explanation is in very simple language, easy to understand. I am expecting more useful videos on some advanced level coding.

Ответить
@saiprakashpawar133
@saiprakashpawar133 - 14.09.2017 09:37

Hi Sir
This is really good Video, Thank you:-)

Ответить