Excel VBA for Post-Beginners: (2/6) Record Code to Duplicate Sheets

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

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

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

    To control the order of the sheets after sheet duplication:
    Try changing this line of code:
    Sheets("Test").Copy After:=Sheets(2)
    To this:
    Sheets("Test").Copy After:=Sheets(Worksheets.Count - 1)
    Or this:
    Sheets("Test").Copy After:=Sheets(Worksheets.Count)
    Worksheets.Count tells us the number of sheets in the workbook. By using Worksheets.Count in the brackets, we are telling Excel to copy the sheet in after the last sheet in the workbook.
    See this video for more on the topic:
    th-cam.com/video/tfcrIa3AR0w/w-d-xo.html

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

    Hi Chris, I just started the first lesson for post-beginners today and I'm very happy to continue your lessons, that every time make me discover more and more interesting things about VBA. Congratulations again for your excellent teaching method and how you have structured this great course! Thanks again and see you soon.

  • @tompendrey5713
    @tompendrey5713 4 ปีที่แล้ว +1

    Really enjoying these lessons - very helpful and clear. As an engineer, I often do a lot of work with spreadsheets and I have for a long time wanted to learn VBA. These videos are the start of that journey for me.

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

      Tom - great to hear and I think you are thinking about it the right way, as a learning 'journey'. Good luck and I hope you'll keep coming back to the channel as you improve.

  • @haroldkingsbury9110
    @haroldkingsbury9110 4 ปีที่แล้ว +1

    Chris, thank you for your efforts to help us, the public, to use and understand the potential of VBA. You are a TIGER.

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

      Harold - thank you so much! I hope you've felt the power and potential yourself ...

  • @Brian-ve2mi
    @Brian-ve2mi 5 ปีที่แล้ว +2

    I can't believe you created this whole series! I can't wait to see what I will learn! Thanks again Chris, your awesome!

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

    Hi Christ I am so glad I began my VBA journey with you. I enjoyed your lessons and for the very first time regaining my faith in learning VBA programming. Excellent teaching !!!

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

      Hello - good to hear your faith in VBA has been restored. The effort is worth it - good luck!

  • @shooterrick1
    @shooterrick1 6 ปีที่แล้ว +2

    Thank you, these tutorials are a lifesaver. The materiel provided by my school isn't very thorough so I'd be lost without this.

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

    I used this method for printing every sheets of my excel file and it was easier by clicking one single button to print out multiple sheets at once! Thank you for this video 👏

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

      Aziz - it's a pleasure and good to hear that the video helped you. Let me know what else you would like to see on the channel.

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

      @@TigerSpreadsheetSolutions will do. You are my idol 😍

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

      @@azizazhar Aziz - very kind of you! Do check out the other videos on the channel.

  • @ShelleyPatterson1
    @ShelleyPatterson1 6 ปีที่แล้ว +4

    I am so happy that I found your tutorials. They are very information and easy to follow. I know that Excel can do what I want it to do but I will have to teach myself VBA first. Wish me luck with my monster spreadsheet!!

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

      Shelley - thanks for the comment and good luck with the spreadsheet! Let us know how it goes...

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

    it's amazing how you make it seem so simple to a seemingly overwhelming VBA coding

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

      Many thanks Everly - with the right approach it is possible to make sense of it!

  • @augustadesousa5238
    @augustadesousa5238 6 ปีที่แล้ว +2

    Great course. I am new using VBA language and your teaching techniques are indeed very helpful. Thanks a lot. Keep posting videos like these, please.

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

    The great teacher I've ever seen on TH-cam. Hope there will have more lessons from you.

  • @shreekantk4083
    @shreekantk4083 8 ปีที่แล้ว +3

    This learning package actually gave me a great start in learning MS Excel VBA......Thank you very Much

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

    Awesome Chris! So incredibly helpful and easy to understand. I really enjoy your delivery, you get right to the point and break it down to its simplest concept. It really makes it digestible to a beginner like myself. Thank you!

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

    Very good. Very pleasant voice and personality - just right for instruction!

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

    Very impressed Chris. Your explanations and teaching style make this easy to understand and memorise what is a very complex part of Excel.
    I'll only be using Tiger Excel for VBA tution (and all aspects of Excel). 10/10

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

    You are an outstanding teacher. It is so nice to follow your courses. Thank you very much - I really appreciate to watch the movies.

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

      Henrik - good to hear, plenty more videos to come so I hope you'll keep following the channel

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

    Appreciate all your time to put these together - Very Helpful!

  • @Nicole-xy8qz
    @Nicole-xy8qz 7 ปีที่แล้ว +4

    This is exactly what I needed, thank you

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

      Thanks Nicole - plenty more VBA videos on the 'VBA for Beginners' playlist, please do share the videos if you think they're helpful! Good luck.

  • @jennybeekman4350
    @jennybeekman4350 6 ปีที่แล้ว +2

    Why is it that once I added the button when I click it to duplicate the sheet, the button is on the duplicated sheet, but it doesn't appear to be on yours. (This is on Dep 4)? Thanks in advance! I'm trying to learn VBA. We need to do something just like this for work!

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

      Hey, Jenny. The most likely reason you are seeing the button in all copies, is that you probably added the button in on the first sheet which is the source for the copies. In the video, he places the button in one of the copy sheets, not on the first. So, when it drew from the source in his video, it drew from a sheet without the button. If you placed it on the first sheet in your workbook, the copies are being drawn to replicate that entire sheet including the newly added button. Hope this is relevant!

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

    I'm binge watching this channel during lockdown rather than binge watching Netflix

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

    You are Awesome!! You are a great instructor. I love your videos. Thank you so much for posting.

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

      Patricia - it's a pleasure and thank you for the comment! Do check out the other video series on the channel.

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

    Fantastic tutorials!!! Thank you very much for creating these videos.

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

      Thanks Jay! Please do share them with somebody else whom you think might benefit...

  • @orrinettegebbeken7680
    @orrinettegebbeken7680 7 ปีที่แล้ว +4

    Hello Tiger, I like your videos. I am having trouble following you sometimes though. I downloaded the random data ss, but I don't see Dep instead of Sheet 1. Thanks for your help!

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

      Hi Orrinette - thank you.
      I have just checked the download file for the random data video and it does appear to be the correct file. Send me an email if you're still having problems - email address on the website.

  • @Sk-ym1uv
    @Sk-ym1uv 6 ปีที่แล้ว +1

    Hi Christ, what should the code be like if I want to add each new sheet to the very end of all sheets?

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

      Hi Edward - use activeworkbook.sheets.count where you specify the sheet number to copy after. Good luck!

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

    Thank you! Your videos are really helpful.

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

    Hey Chris! Thanks a lot for your awesome videos. I just started learning VBA today and decided to go all the way with your instructions. I have a question on this video though: How come each time you press the button, the second sheet does not get replaced? Because usually I expect a loop to be in there and change the sheet number! Many thanks.

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

      Hessam - we cannot change the sheet index number (only by re-ordering the sheets in the file). This is how the mechanism works because it excludes sheets using the index number.

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

    Really a perfect teacher ......

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

    Hi Chris, I have one question. Everyday i open near about 5-6 excel workbooks which ultimately has 5-8 different worksheets in each workbook. What i do is, everyday i open those one by one and copy the data in Master workbook. How do i automate this? The data is completely different in all worksheets so i am just confused. Thanks for your prompt attention in advance.

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

      Hi there - check out some of our videos on working with multiple files, we have just covered this topic in Members' Monday too. Good luck.

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

    I like your presentation. You did a step by step. I will keep following your videos as I need to do some routine at work. It's basically I want our SAP data base management system(list of parts withe pricing) to generate an excel file. Do you have this topic. Again thank you.

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

      Hi Arnel. Thank you! No, I don't currently have a video about that particular situation, but the VBA for beginners playlist will definitely help you in a more general sense. Good luck!

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

    In my macro code, there was an extra line... what does it mean?
    Sub DublicateSheet()
    '
    ' DublicateSheet Macro
    '
    '
    Sheets("Sheet1").Select
    Application.CutCopyMode = False
    Sheets("Sheet1").Copy After:=Sheets(2)
    End Sub
    " Application.CutCopyMode = False" why this line appear?
    thanks

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

      Hi Mohammed - good question. This line of code exits cut / copy mode. It means that Excel clears the clipboard of anything that has been cut or copied. It also means that the dashed lines around anything that you have cut / copied disappear too.

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

    Please help me. I followed the steps and it already appears here "stop recording" and then when I tried to move or copy and clicking ok, "This will close the workbook without saving. Some macro modules will be lost. Do you wan to move the selected sheets anyway?" will pop up. I don't know what to do.

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

      Hhhmmm, I am not sure. Make sure the workbook is saved as a macro-enabled workbook.

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

    First of all, thank you and admire your work. I have a question. When I run the macro is copying the button as well. How could I fix that ? I want it copied without the button. The code is the same, but...

  • @ahmad.s4723
    @ahmad.s4723 9 ปีที่แล้ว +5

    I would love to learn Excel VBA with you.. thanks

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

    My duplicated sheets have the macro buttons too . How to make sure that just the original sheet has the macro button?

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

      Try changing the settings on the button. If you right click on the button, somewhere you can find an option 'don't move or copy with sheets' - this should mean the button does not copy over. Try Googling it for precise instructions - good luck!

  • @AbidHussain-pb2gm
    @AbidHussain-pb2gm 7 ปีที่แล้ว +1

    Hello Tiger,
    I really like your way of teaching. Thumbs up!
    I am new learner of VBA, i have command on excel and some know how about macros(through recording) but knows nothing about VBA language.
    Can you please guide should i keep watching your videos to learn execution of macros through VBA or i should learn VBA first??
    Thank you!!

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

      Abid - great question!
      I think the only way to learn VBA is by trying to do VBA.
      I have received similar queries in the past - asking for a list or a glossary of VBA terms. Such things are available on line, but for me they should be used for reference only, and not for guiding learning.
      VBA is a skill and you can only improve by trying to do it.
      You could read many books about basketball, watch all the games, study the great players; ultimately, it would not really improve your game. You can only improve your game by practising on the court.
      I recommend the same approach to computer programming. You'll make a ton of mistakes as you go along, but these should be accepted and indeed embraced as part of the learning process. I still make mistakes today as you can see in the videos - I include all the mistakes (I do not really 'edit' the videos) so that viewers can appreciate the importance of mistakes in the learning process.
      I hope this helps and good luck.

    • @AbidHussain-pb2gm
      @AbidHussain-pb2gm 7 ปีที่แล้ว +1

      Thank you for your feedback, i will get back to you once i tried things you mentioned.

  • @raviyadav-oc4bv
    @raviyadav-oc4bv 8 ปีที่แล้ว +2

    hi sir , your teaching skills is awesome .

  • @teklehaimanotaman3150
    @teklehaimanotaman3150 4 ปีที่แล้ว +1

    Thank you much Chris, really appreciable. How about doing the other way, that is deleting the sheets?

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

    Hi how would manipulate the code so that the new sheet would be added to the end each time instead of a position ?

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

      Try changing this line of code:
      Sheets("Test").Copy After:=Sheets(2)
      To this:
      Sheets("Test").Copy After:=Sheets(Worksheets.Count - 1)
      Or this:
      Sheets("Test").Copy After:=Sheets(Worksheets.Count)
      Worksheets.Count tells us the number of sheets in the workbook. By using Worksheets.Count in the brackets, we are telling Excel to copy the sheet in after the last sheet in the workbook.

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

    In duplicate sheets(video 2/6) when you move or copy for a duplicate sheets in the Move or Copy box its showing (Macro to duplicate sheets with Code.xlsm) but when I Move or copy its just the simple make a duplicate copy....Please clear this ....Thanks

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

    Quick question, what happens if a module isn't being created once I stop recording the macro?

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

    very helpful. Big thanks!

  • @rosenmwenze72
    @rosenmwenze72 4 ปีที่แล้ว +1

    let's say the workbook 1 contains the grade 8 max recode and workbook 2 contains the grade 11 max record, in this want is possible to be running the marco on the workbook 1 in workbook 2 , thank you for your time sir...

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

      Hi there - it's possible for a macro to call on different workbooks. We have a series called 'How To Work With Other Workbooks In Excel VBA', or similar - check out that series ...

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

    Hi Chris
    When i write the code i get this code
    Sub copysheet()
    Sheets("Sheet1").Select
    Application.CutCopyMode = False
    Sheets("Sheet1").Copy After:=Sheets(1)
    End Sub
    Can I skip this part -- Application.CutCopyMode = False

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

      Looks fine to me Deepali. Is the name of the sheet ("Sheet1") the problem?

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

      Hi Chris , since i am beginner i don’t understand Application.CutCopyMode = False . Without that also my code works. But since i record the steps i get this step.
      What does this means ? Application.CutCopyMode = False

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

    Great great videos!!!!

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

    Hi your videos is awesome, I'm learning a lot. can you create a tutorial for Inventory Management using VBA?

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

      Hi there - it's an interesting idea for the future. Are you working on something in particular? You can email me via the website if you like. Good luck with the VBA!

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

    Every time I attempt to duplicate a sheet using your practice workbook, I get an "Invalid Name Error" in the Days Service column.....it errors out on the duplicate and the original sheet, what could be causing this? Thanks, I enjoy your videos!~

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

      Matthew Wright Hi Matthew - glad to hear you like the videos! Hhmm, I would compare your code to the code I provide, and look for differences. It sounds like you may have deleted the value in the cell that the Days Service formula refers to. If all else fails, send the file to me via the contact page on the website. Good luck!

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

    love your vids mate!
    So pretending one of my sheets I was duplicating was named 'Data1', to name the sheet specifically instead of a numerical reference, would the necessary code have looked like this ... .sheets("Data1")

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

      Yes - that should work. So you have two main referencing techniques - one using a name and the other an index number, both useful in specific situations. Plenty more vids to work through!

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

    Hi Chris thnx for this videos, Could you do please a video on how do we can pass an a variable throught macros when its trigerred by a button. means different buttons triggers the same function but with different argument each time thanks

  • @سیدصادقعلوی-س5ق
    @سیدصادقعلوی-س5ق 3 ปีที่แล้ว +1

    THANK YOU SO MUCH BRO. YOU LOOKS LIKE JAMIE VARDY DUDE :))

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

    Is it possible to increase the volume

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

      Hi Akash - I just checked and I do think the volume level is reasonable. The audio quality should be improved in more recent videos, however.

  • @SaadKingsta
    @SaadKingsta 6 ปีที่แล้ว +2

    Thank you for your wonderful videos. This is my start from scratch

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

    why did it create the sheets out of order

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

      Hi there - I deal with that question in this follow-up video, around 7 minutes:
      th-cam.com/video/tfcrIa3AR0w/w-d-xo.html

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

    These videos are awesome

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

      Thanks Jon - please do spread the word!

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

      Tiger Spreadsheet Solutions witch program is the easiest for beginners?
      java, C++, VBA, Python

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

    What should i do if i wanna duplicate the sheets always to end?

    • @TigerSpreadsheetSolutions
      @TigerSpreadsheetSolutions  8 ปีที่แล้ว +4

      +Mehmetcan Muslu Good question.
      Try changing this line of code:
      Sheets("Test").Copy After:=Sheets(2)
      To this:
      Sheets("Test").Copy After:=Sheets(Worksheets.Count - 1)
      Or this:
      Sheets("Test").Copy After:=Sheets(Worksheets.Count)
      Worksheets.Count tells us the number of sheets in the workbook. By using Worksheets.Count in the brackets, we are telling Excel to copy the sheet in after the last sheet in the workbook.

  • @bo-bx5hn
    @bo-bx5hn 6 ปีที่แล้ว +1

    So do you work for tiger? Just joking. Good videos, but I wish you explained it from more of a programming perspective, but that's just because I have other programming experience.
    excel using instead of != is ridiculous BTW.

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

    Interesting that my Days Service
    column all changed after making the copy action to (#name?).....i wonder what is happening

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

      Trying lining up the Windows and stepping through the code to establish when and what happened. Good luck!

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

    Grazie!

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

    Thanks

  • @dvaliantenvr.hubspot2703
    @dvaliantenvr.hubspot2703 5 ปีที่แล้ว +1

    Awesome

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

    I wish I was locked down in a darkroom 0:13

  • @hoolia4987
    @hoolia4987 6 ปีที่แล้ว +3

    So smart I don't care what he looks like, and so gorgeous I don't care what he's saying, ha

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

    But one sheet is plenty

  • @amyf5521
    @amyf5521 4 ปีที่แล้ว +1

    Some constructive criticism: We actually don't need to see you so to have your frame so big and in front of the excel window is really annoying. And things in excel can be hard to see in videos so to have that window so small and in back is also very frustrating.

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

      Appreciate the feedback but 100k + views suggests this is not a problem for most

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

    Thanks Chris Dean AUstralia