Excel VBA Introduction Part 6 - Worksheets, Charts and Sheets

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ย. 2024

ความคิดเห็น • 190

  • @GaganDeep-mj5hi
    @GaganDeep-mj5hi 3 ปีที่แล้ว +3

    Best channel to learn VBA. I learnt from this a lot.

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว

      Thanks so much, I appreciate the comments!

  • @34SideWinder
    @34SideWinder 9 ปีที่แล้ว +1

    My company paid like $1000 dollars for me to take a VBA course that was half as useful as these videos. You are doing a wonderful thing posting these.

  • @xargon666
    @xargon666 5 ปีที่แล้ว +5

    I've been doing VBA for the office for a while, and I have still learned some invaluable lessons from these videos. You can feel the genuine excitement through all the tips and tricks, and the professionalism of the presentation surpasses most class rooms - that's some damn good VBA!

  • @maurocastagnera8949
    @maurocastagnera8949 7 ปีที่แล้ว +1

    Simply fantastic! Clear, simple, gradual, essential. Thanks endless!

  • @smujawer
    @smujawer 8 ปีที่แล้ว +14

    It's the world's best online training institute.
    Andrew, Almighty has made you very talented.
    Please keep on sharing the knowledge.
    May Almighty bless you.

    • @9808529787
      @9808529787 6 ปีที่แล้ว

      Andrew I got a new analyst job just because I manipulated the interview only after watching few of your videos and later on I learn before I actually started the job lol. Anyways lot of analysts actually suggest watching you. Cheers Mate!!

  • @CherryBlossom85009
    @CherryBlossom85009 6 ปีที่แล้ว

    I search tutorial, and in trial and error I have found that yours are the best. I no longer waist time watch other ones. I've watch and take notes on about a dozen of your videos. It's allow me to improve process and work. I now have code to do just about every thing I need to do, even opening up a text file. LOL... But I open several at a time. YOU ARE THE BEST, THANK YOU. I just bought your book Introduction to Excel VBA.

  • @sasavienne
    @sasavienne 5 ปีที่แล้ว +4

    Thanks to the best VBA teacher worldwide. I have really watched many tutorials. Your ones are undoubtedly the best.
    🌟🌟🌟 🌟 🌟 🌟 🌟 🌟 🌟 🌟

  • @sindnee
    @sindnee 6 ปีที่แล้ว +1

    I'm only on video 6/77 but I feel like I've already learned so much from watching this. Kudos to the instructor for making the lesson so easy to understand.

  • @christophersinanan886
    @christophersinanan886 5 ปีที่แล้ว

    In my job VBA is used everyday and I had no zero experience prior so thanks to you I'm not fired :)

  • @rahulshroff3166
    @rahulshroff3166 9 ปีที่แล้ว

    Andrew, you are simply class.

  • @wasiuayandotun9973
    @wasiuayandotun9973 5 ปีที่แล้ว

    WiseOwl, this instructor is good. He has left nothing untouched, very thorough and direct.
    Thank you so much for sharing the knowledge. You are blessed.

  • @johassan6509
    @johassan6509 4 ปีที่แล้ว +2

    Although this is a few years ago now lol, I have found this to be the best to learn from.Lots of things are repeated over and over again, which is great because it is not assumed you know what you are doing. I have watched 3 other tutors, watching so many of their videos, but at last I have found this. very happy

    • @WiseOwlTutorials
      @WiseOwlTutorials  4 ปีที่แล้ว

      Hi Jo, these videos are getting a bit old now, you're right! We recently updated the earlier videos in this series and created a separate online tutorial covering the basics of VBA www.wiseowl.co.uk/online-training/excel-vba/
      The tutorial covers everything up to around Part 19-20 of the older series and has downloadable files and exercises.
      Just in case you were looking for something a little more up to date!

  • @TheRealAK786
    @TheRealAK786 7 ปีที่แล้ว

    As a Recent Graduate in Business and Finance, VBA/SQL are industry standard skills one must have in the field of finance. Thank you for your excellent teaching!

  • @Alhusam
    @Alhusam 7 ปีที่แล้ว

    I don't know what to say except that it can't be better than this.
    May God bless the Very amazing Tutor.
    Tanks of thanks.

  • @philippemichelvidori7248
    @philippemichelvidori7248 7 ปีที่แล้ว

    You've got talent for teaching ! I've been playing with Excel for years, but never VBA. I see the power now ! You can do anything and much faster !

    • @philippemichelvidori7248
      @philippemichelvidori7248 7 ปีที่แล้ว

      I'm working as a mechanical engineer and use Excel as my calculation and reporting tool along with Word so as you say VBA is will enhance my productivity, that's for sure. I see that one has to be careful with worksheet names ( between what the user sees and what is ). I'm going to contribute to your cause for sure. I'm learning Python as well

  • @PADRONJORGEL
    @PADRONJORGEL 7 ปีที่แล้ว

    Hello you all.... SIMPLY one of best channels i have seen so far that covers the Excel VBA, Thank you .

  • @VijayendranRaghavendran
    @VijayendranRaghavendran 7 ปีที่แล้ว

    I immensely appreciate your content delivery. As a presenter, you have a beautiful voice which makes learning enormously motivating as well as inviting. Thanks for putting in so much work in these videos; one also learns about presentation skills thorough your videos. I am from the UK, and I really hope to see you one day. Thanks, Vijay

  • @chenchenli6755
    @chenchenli6755 10 ปีที่แล้ว

    excellent teaching! I started with no knowledge of VBA, but your teaching is very clear ! I have learnt a lot, thank you very much! After VBA, I will watch your SQL vedios.

  • @nikolaytkachenko4695
    @nikolaytkachenko4695 5 ปีที่แล้ว

    Your lessons are extremly usefull for learning VBA.
    I am Ukrainian, actualy i don't understand completly your language, but i understand code language VBA. Thanks for good lessons, the first one is VBA and the second one is English.

  • @angepatrickzaipo3183
    @angepatrickzaipo3183 11 หลายเดือนก่อน +1

    Thank you so much, Wise Owl, Before I was afraid of VBA until that I ask ChatGPT, How can I learn VBA, and it gave me your TH-cam channel, Since this moment, I feel good with VBA and I learn more every day.

    • @WiseOwlTutorials
      @WiseOwlTutorials  11 หลายเดือนก่อน

      I'm really happy to hear that you're finding the VBA videos useful! Thanks for taking the time to leave a comment and for watching!

  • @briancox5562
    @briancox5562 8 ปีที่แล้ว

    Your teaching style is excellent, thank you for taking the time to put these together!

  • @tristanquintus3200
    @tristanquintus3200 10 ปีที่แล้ว

    Excellent lesson, simply and concisely delivered. Thank you for sharing your MS Excel knowledge with your viewers.

  • @manishahanavate2613
    @manishahanavate2613 8 ปีที่แล้ว

    All your VBA Videos are very resourceful ... i must say you have tried to teach minute details in your videos... thanks a lot

  • @Crazy-Komerican
    @Crazy-Komerican 10 ปีที่แล้ว

    I am watching this TH-cam video for learning about this VBA, and truly, I appreciate all your instructing... I appreciate you put all together, and explaining this hard programing easy. I am Blessed to know you, WiseOwl. thank you!

  • @tfcscrewdriver
    @tfcscrewdriver 5 ปีที่แล้ว +1

    Thank you so much for these tutorials! So easy to follow and helpful - should have discovered these videos years ago !!!

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 ปีที่แล้ว

      Thanks Gerald! Happy to hear that you're finding them useful!

  • @DuApril
    @DuApril 10 ปีที่แล้ว +4

    My favorite youtube tutorials vba and sql. You are awesome, Andrew!

  • @darekolak1874
    @darekolak1874 4 ปีที่แล้ว

    Fantastic course. Not only for beginners - I have been using VBA for long time by now, but I have learned new tricks and generally the course let me a kind of declutter my knowledge. Thanks a million.

  • @JanBolhuis
    @JanBolhuis 7 ปีที่แล้ว

    Thank you for this video and your great lessons. As many other people already mentioned, you're extremely clear and the way you explain VBA is very easy to follow.

  • @nicoleta9660
    @nicoleta9660 9 ปีที่แล้ว

    Your tutoriels are so clear and ease to follow! Thank you so much for doing that for us Andrew!

  • @jabusch24
    @jabusch24 10 ปีที่แล้ว

    honestly your videos are amazing. i never expected myself to learn as quick. thank you very much!

  • @aleksandrbardin938
    @aleksandrbardin938 3 ปีที่แล้ว +2

    WiseOwl thanks for the effort you put into your work! Really appreciate your tutorials and it is not only useful but even fun to watch! Only the best to you!

    • @WiseOwlTutorials
      @WiseOwlTutorials  3 ปีที่แล้ว

      Thank you Aleksandr! I'm happy that you're enjoying the videos and thank you for taking the time to leave a comment!

  • @dlugo1650
    @dlugo1650 10 ปีที่แล้ว +44

    WiseOwl who is this instructor? He is brilliant! I have learned so much!

    • @dlugo1650
      @dlugo1650 10 ปีที่แล้ว

      Haha that response truly made my day!

    • @jetpaq
      @jetpaq 10 ปีที่แล้ว +8

      I SO AGREE! hes absolutely amazing. So precise and thorough, and usable examples that freaking WOrk!!! tytytytytytytyty

    • @nikunjbhatt2124
      @nikunjbhatt2124 6 ปีที่แล้ว

      Not Batman but New version: Owlman

  • @nikoladjuranovic7915
    @nikoladjuranovic7915 9 ปีที่แล้ว +3

    I would just like to thank you for your awesome tutorials! You Sir, have some great teaching skills and voice :D

  • @lisaliu4249
    @lisaliu4249 6 ปีที่แล้ว

    Thanks for your video, I learn your video every evening. You really help me a lot!

  • @nonameghost
    @nonameghost 9 ปีที่แล้ว +8

    You are Amazing.
    Hope you have a wonderful life.

  • @eagle007l
    @eagle007l 10 ปีที่แล้ว +1

    Sir. thank you are so brilliant, the way you teach is very easy to learn
    keep up the wonderful job. God bless you and congratulatios.
    You have a new friend in Colombia.

  • @Dhrsha
    @Dhrsha 6 ปีที่แล้ว

    The way you teach is awesome! Great work!

  • @jaideepsaharan9785
    @jaideepsaharan9785 6 ปีที่แล้ว +1

    it's amazing... I'm loving it.. the way trainer explain, that is awesome..😊

  • @bogdanudovicic391
    @bogdanudovicic391 8 ปีที่แล้ว +1

    I find this very helpful and thank you for sharing the knowledge.

  • @bernisal
    @bernisal 10 ปีที่แล้ว

    Super teaching technique, very pleasing voice. Thank you.

  • @tcca2002
    @tcca2002 10 ปีที่แล้ว +1

    Yes, it's a briliant tutorial. Thanks so much!

  • @rajaa25
    @rajaa25 10 ปีที่แล้ว

    Andrew,
    Brilliant Teaching. I enjoy your tutorials very much.

  • @sid2902
    @sid2902 8 ปีที่แล้ว +1

    This is AMAZING. Genuinely thank you so much

  • @bhaiyyu
    @bhaiyyu 8 ปีที่แล้ว

    I loved the refering to sheets by code method!

  • @saifullahsani6944
    @saifullahsani6944 5 ปีที่แล้ว

    This tutor is awesome

  • @13amahesh
    @13amahesh 9 ปีที่แล้ว

    Going through your wonderful tutorials... well paced with useful contents. Thanks for sharing the knowledge and time.

  • @rfrakesh
    @rfrakesh 8 ปีที่แล้ว

    excellent videoes on VBA. Thank you for your valuable time for making and sharing such nice videoes..!!!

  • @alinaroginska
    @alinaroginska 6 ปีที่แล้ว

    Bought a book! Yay (goosebumps!!) can’t wait to study it! Will check the website for everything else for sure! Thank you!!;)

  • @Amit_the_Analyst
    @Amit_the_Analyst 7 ปีที่แล้ว

    thank you sir. Very useful as usual ..keep it up the good work please for us. I am fan of your teaching style and knowledge.

  • @maurocastagnera8949
    @maurocastagnera8949 6 ปีที่แล้ว

    Dear Andrew, I never found a teacher clear, simple, practical, competent and that made me passionate about a subject like you. I no longer really know how to thank you for the joy with which I watch your videos, which make me learn something more each time .. You are really fantastic!
    A question please: is there a way when VBA goes wrong, instead of pointing out in yellow the whole line of code, to highlight the single part of the line where there is the error?
    Thanks again. Ciao!

  • @b.petrushchak
    @b.petrushchak 9 ปีที่แล้ว +1

    Thank you for an interesting video. I've been writing macros for some time, but the part related to using worksheets' codename property was new to me.

  • @zihaocai1162
    @zihaocai1162 8 ปีที่แล้ว

    best tutorial ever....head-chop guaranteed

  • @ashokkandukury2870
    @ashokkandukury2870 8 ปีที่แล้ว

    thank you Andrew....
    sharing the wisdom

  • @KM-co5mx
    @KM-co5mx 2 ปีที่แล้ว +1

    Awesome once Again! 🙏

  • @alinaroginska
    @alinaroginska 6 ปีที่แล้ว

    I love you man!! The best tutorial ever! If you have got any book written for coding or any other excel tips please let me know!!;)

  • @soromero
    @soromero 5 หลายเดือนก่อน

    Great videos, no doubt the best in TH-cam for learning VBA!
    Apparently, you can change CodeNames programatically, for instance:
    Sub change_code_name()
    Dim wbk As Object, sheet As Object
    ActiveWorkbook.VBProject.Name = "VBAProject"
    Set wbk = ActiveWorkbook.VBProject.VBComponents(ActiveWorkbook.CodeName)
    wbk.Name = "wbk_code_name"
    Set sheet = ActiveWorkbook.VBProject.VBComponents(ActiveWorkbook.Sheets(1).CodeName)
    sheet.Name = "sheet_code_name"
    End Sub
    (access to the VBAProject is required, check macro settings).

    • @WiseOwlTutorials
      @WiseOwlTutorials  4 หลายเดือนก่อน

      Thanks for sharing! Indeed you can!

  • @mannix34
    @mannix34 2 ปีที่แล้ว +1

    Great work! Thank you!

  • @wellsyee4415
    @wellsyee4415 4 ปีที่แล้ว

    So nice tutor. Thank you so much

  • @anthonyaguirre6101
    @anthonyaguirre6101 7 ปีที่แล้ว

    I certainly did find that useful. Thanks!

  • @barryc7443
    @barryc7443 7 ปีที่แล้ว

    most amazing vba

  • @tristinknee5650
    @tristinknee5650 6 ปีที่แล้ว +1

    I really love your tutorials! The other 5 so far I have been able to work alongside you and do what you're doing to learn from doing it myself, but with this one, I couldn't really do that because I didn't have the base excel file. That is literally my only complaint so far! Considering this video is almost five years old though, I don't see you adding a download link in your description! Haha

    • @anythingpeteives
      @anythingpeteives ปีที่แล้ว

      Just coming back to using Excel and VBA after several years and away and agree with you on this one. Not sure why manipulating Charts is here when no mention of how to create them in the first place. Had to do some study elsewhere on how to create a Chart just so I could follow along with this tutorial.

  • @torque6389
    @torque6389 6 ปีที่แล้ว

    This guy is awesome!

  • @sf9530
    @sf9530 7 ปีที่แล้ว

    Great videos. Learned so much. Do you have a video on how to select all sheets in a workbook and format all cells in a range?

  • @shahimkhlaifat
    @shahimkhlaifat 10 ปีที่แล้ว

    really awesome, more plentiful than is usual or necessary.

  • @alycea8362
    @alycea8362 6 ปีที่แล้ว

    14:42 If you are unable to change the code name because you are getting the message "invalid property value" follow these instructions. In your workbook, go to Options -> Trust Center ->Trust Center Settings and check the box for "Trust access to the VBA project object model"

  • @3171320d
    @3171320d 11 ปีที่แล้ว

    very good explained, Thanks a lot

  • @tytorrance96
    @tytorrance96 10 ปีที่แล้ว

    Wise Owl, great VBA videos after watching your videos along with my VBA book I feel I'm in pretty good shape.
    In your VBA video #6 you say you are going to do a video with how to save and close documents, I was wondering will that video also explain Dim for variables? Thanks for your videos looking forward to the new ones.

  • @Search4Knowledge
    @Search4Knowledge 8 ปีที่แล้ว

    Another great tutorial!

  •  10 ปีที่แล้ว

    Thank You! Awesome Tutorial

  • @ashokkandukury2870
    @ashokkandukury2870 8 ปีที่แล้ว +1

    God send you to teach... Wow!!

  • @arulrajesh
    @arulrajesh 7 ปีที่แล้ว +2

    35:42 You can't write code to change the codename? I am sure Andrew can do anything, maybe if you trust access to the VBA project model.
    Your tutorials are just amazing. Let me say that again. Your tutorials are just amazing, even my dog thinks so.

    • @arulrajesh
      @arulrajesh 7 ปีที่แล้ว +1

      try ActiveWorkbook.VBProject.VBComponents("Sheet1").Name = "NewCodeName" should do it. :)

  • @johnnyxing2955
    @johnnyxing2955 7 ปีที่แล้ว

    Really Comprehensive and easy to understand. But is there any fast way to remember these functions? or I guess I just need to have more practices to get acquaint and familiarized with these functions :)

  • @SyedKollol
    @SyedKollol 10 ปีที่แล้ว

    your videos are the best....

  • @primazzo1
    @primazzo1 9 ปีที่แล้ว

    Thank You! I can not afford to pay for these instructions. In this instance the old maxim " you get what you pay for" does not apply.

  • @lavitaneja4161
    @lavitaneja4161 7 ปีที่แล้ว

    really brilliant

  • @DodgyNZ
    @DodgyNZ 10 ปีที่แล้ว

    excellent tutorial... thanks heaps.

  • @bavajikj3267
    @bavajikj3267 3 ปีที่แล้ว +1

    Thanks

  • @djamail75
    @djamail75 10 ปีที่แล้ว

    Great teaching. When new vba tutorial?

  • @michaelsilverberg2623
    @michaelsilverberg2623 8 ปีที่แล้ว +1

    In the beginning of the lesson, where did the first chart come from? How did you create it?
    Regarding Choosing Where to Insert Worksheets, the tab names of the three new sheets appear in descending order. Without using VB Editor, how do I program Excel so they appear in ascending order?
    And how do I program it so that the new worksheet tab in 16:50 reads Sheet1 instead of Sheet5?

  • @HoangNguyen-pv6fz
    @HoangNguyen-pv6fz 10 หลายเดือนก่อน +1

    22:04 😊

  • @NB-st5tj
    @NB-st5tj 9 ปีที่แล้ว +1

    Hello Andrew,First of all thank you so much for posting these videos. They are so helpful for me. I appreciate your work. But I also need some other help. I have an interview at the end of this month and since I have to write a test along with my personal interview, I want to know whether these videos will be enough for me to learn VBA excel or should I refer some other things also?

    • @NB-st5tj
      @NB-st5tj 9 ปีที่แล้ว

      Thank you for the reply!
      I was trying to do one task but couldn't complete it. Can you help me in it? My question is-
      I have to transfer data from one workbook to another workbook automatically with a user friendly interface so that should it allows user to select the data for copying) and also if there are any blank fields in the data, they should be left blank.

  • @analkinkhabwala7680
    @analkinkhabwala7680 6 ปีที่แล้ว +1

    I dont know why , but is am getting error called "object required", can you please help

  • @anupkumar.m9688
    @anupkumar.m9688 7 ปีที่แล้ว

    Very very thanks Wiseowl for these videos.
    I have one doubt from this session (Part-6). How can you delete multiple sheets, let's say: to delete 3 selected worksheets in same workbook. Is there a single command to execute this in one go.

  • @simonelykkevestergaard6492
    @simonelykkevestergaard6492 7 ปีที่แล้ว

    Hi ! Amazing videos!
    One question: Is there anywhere I can download/see all the codes written during the videos (just in txt. format e.g.), so I don't have to go through the video again to see the syntax of something specific?

  • @JesusM22
    @JesusM22 10 ปีที่แล้ว

    Great video! Is there a way to close a worksheet before the workbook is closed? I have two macros that hide and unhide a worksheet, but I'm having trouble finding a way to have it automatically close when the entire workbook is closed. Not sure if that makes sense or not. Thanks in advance!

  • @hudaabuel-hassan4708
    @hudaabuel-hassan4708 9 ปีที่แล้ว

    Hi WiseOwl, after thanking you for your great efforts, I have learned a lot from your videos!
    Just a quick notification, in the above video "Excel VBA Introduction Part 6 - Worksheets, Charts and Sheets", at min 32, video stops loading or working and it freezes for ages, any idea please about this issue, or can you re-upload it?
    Thanks,
    Huda

  • @windandkitesurfer
    @windandkitesurfer 5 ปีที่แล้ว

    I'm on Office 2016 and this is all very relevant however not sure that the distinction between "charts" and "worksheets" are relevant as seems you can combine one into the other

  • @liweiguo1560
    @liweiguo1560 10 ปีที่แล้ว

    Hi, thank you very much for this brilliant video, which helps a lot. However, here i got a little confused with the intellisense, when i wrote [ worksheets("sheet1"). ] it didn't show up and after i typed copy by myself and hit space once the arguments for before or after didn't show up either. so should it be like this? Look forward to hearing from you.

  • @FRANKWHITE1996
    @FRANKWHITE1996 8 ปีที่แล้ว

    thank you

  • @irynamusiiovska828
    @irynamusiiovska828 6 ปีที่แล้ว

    Thank you!

  • @callmered100
    @callmered100 7 ปีที่แล้ว

    Very good online tutorial! By the way, where is the link to download data for practice?

  • @Mansoorsadat
    @Mansoorsadat 9 ปีที่แล้ว

    Hi Andrew,
    Thanks for your wonderful tutorials. Today I am bamboozled by a simple code. Worksheets(paEXtract).Activate, generates a runtime error 13. I am not sure what is wrong. Could you pleaser help?
    Thanks

  • @AnkitKumar-ey9mh
    @AnkitKumar-ey9mh 7 ปีที่แล้ว

    very helpful vedio

  • @Gk2810_
    @Gk2810_ 10 ปีที่แล้ว

    Full of Detailing ... so nothing is left behind ...

  • @zozozozo43
    @zozozozo43 6 ปีที่แล้ว

    ty very much , and how can we change the CodeName of a newsheet?

  • @HoangNguyen-pv6fz
    @HoangNguyen-pv6fz 10 หลายเดือนก่อน +1

    38:34 😊

  • @davegoodo3603
    @davegoodo3603 6 ปีที่แล้ว

    Hi Andrew, watching this video reminded me of something that has come up, (for me), in many of your videos. That is the question of indices and whether they are 0 based or 1 based? I sometimes get caught out on this, is there a rule or a way of telling when an index is one or the other? Thanks.

    • @karelkohout
      @karelkohout 2 ปีที่แล้ว

      It's simple. Arrays are zero based, unless you make them not to be so. Collections (and I think everything else) is one based.

  • @হোনোলুলুর_হুতুমপেচা

    Sir, thanks a lot for these coursework... I am following this series from Part 1.... But I am facing a problem with Sheets() command... this is showing compile error.... I am using office 2007...

  • @tomash9785
    @tomash9785 9 ปีที่แล้ว

    Hi Andrew
    great tutorial. one question comes up, Is it possible to change visible property to veryhidden and than disable for other users to change this property ?

    • @tomash9785
      @tomash9785 9 ปีที่แล้ว

      ***** yes ,definitely helps. I keep watching your videos !

  • @zubairkahn1983
    @zubairkahn1983 2 ปีที่แล้ว

    Hi Andrew, thank you for the lovely tutorial. Old is gold so the this and other tutorials in this series never get old.
    I have a short question. I wrote a code which is copying specific data from one workbook (only one sheet) and copies it to a new workbook in different sheets depending upon some criteria. The code works perfectly fine till it inserts fifth sheet (data copying works fine for fifth sheet). Only after that when I expect the code to insert another sheet (sheet 6), I get "Run-time error '9', Subscript out of range". I am copying the section of the code which inserts new sheet in the Output_workbook.xlsm.
    ' here j takes the value of sheets count when the code starts and stays in the same index number
    j = Workbooks("Output_workbook.xlsm").Sheets.Count
    Workbooks("source_workbook.xlsm").Worksheets("KgKw").Activate
    If Range("A2").Offset(i, 2).Value Range("A2").Offset(i - 1, 2).Value And Range("A2").Offset(i, 2).Value "" Then ' i is the data counter in the source_workbook.xlsm

    Workbooks("Output_workbook.xlsm").Sheets(j).Range("A:D").EntireColumn.AutoFit
    Workbooks("Output_workbook.xlsm").Sheets.Add after:=Sheets(j)
    ' after inserting the new sheet, value of j is being updated
    j = Workbooks("Output_workbook.xlsm").Sheets.Count

    End If
    Could you give any hints as why the code fails after inserting five sheets?
    Thank you,
    Zubair

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 ปีที่แล้ว

      Hi Zubair! You've been very careful to explicitly reference the sheets collection in the respective workbooks except in one place:
      Workbooks("Output_workbook.xlsm").Sheets.Add after:=Sheets(j)
      Try this:
      Workbooks("Output_workbook.xlsm").Sheets.Add after:=Workbooks("Output_workbook.xlsm").Sheets(j)
      I hope it helps!

    • @zubairkahn1983
      @zubairkahn1983 2 ปีที่แล้ว +1

      @@WiseOwlTutorials thank you for the hint. I actually figured it out and now the code is completely error free.

    • @WiseOwlTutorials
      @WiseOwlTutorials  2 ปีที่แล้ว +1

      @@zubairkahn1983 Happy to hear you found a solution!