Wise Owl Answers - How do I split text into multiple rows in Excel VBA?

Check out our other answers here • Wise Owl Answers
Get files here www.wiseowl.co.uk/vba-macros/...
If you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos, you can click this link www.wiseowl.co.uk/donate?t=1​ to make a donation. Thanks for watching!
This video shows you how to use the Split function in VBA to divide a string into multiple substrings based on a delimiter character. You'll also see how to capture the result of the Split function in an array and write the contents of the array into cells in a worksheet after inserting new rows to make space for the new values.
Chapters
00:00 The Question
00:42 The Basic List
01:36 Splitting a String
03:51 Counting Through an Array
05:23 Writing Array Values into Cells
06:55 Resetting the Worksheet
08:24 Inserting Rows into the Worksheet
09:31 Resetting the Worksheet
10:54 The Find and FindNext Methods
16:22 Avoiding Endless Loops with FindNext
18:00 Finishing Touches
Visit www.wiseowl.co.uk for more online training resources in Microsoft Excel, Power BI, DAX, SQL Server, Reporting Services, Analysis Services, Integration Services, ASP.NET, C#, Visual Basic, Microsoft Access and more

Пікірлер: 59

  • @grzegorz2852
    @grzegorz28522 жыл бұрын

    Man, u are the best. i have bought ur yt subscription and after seeing this video, I 100% don't regret that. HUGE THANKS

  • @WiseOwlTutorials

    @WiseOwlTutorials

    2 жыл бұрын

    Thank you for the support, I'm pleased to hear that you found it useful!

  • @dineshanblazahan9843
    @dineshanblazahan98432 жыл бұрын

    Great video , I think ur born to teach … hats off to your teaching skills

  • @WiseOwlTutorials

    @WiseOwlTutorials

    2 жыл бұрын

    Thanks Dinesh!

  • @shahir051
    @shahir0512 жыл бұрын

    Many thanks to this video. Very much helped...

  • @WiseOwlTutorials

    @WiseOwlTutorials

    2 жыл бұрын

    Happy to hear that Shahir, thanks for watching!

  • @simpabar1066
    @simpabar10663 жыл бұрын

    Thank you Mr. Andrew 🤝👍👍

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    You're very welcome Sim!

  • @francis1457
    @francis14572 жыл бұрын

    thanks a lot that made my life very easy as I was starting to scratch my head :D

  • @WiseOwlTutorials

    @WiseOwlTutorials

    2 жыл бұрын

    Happy to hear that it helped, Francis. Thanks for watching!

  • @user-ij2pi8se3x
    @user-ij2pi8se3x Жыл бұрын

    truly lovely indeed magnificent code

  • @WiseOwlTutorials

    @WiseOwlTutorials

    Жыл бұрын

    Glad you liked it, thanks for watching!

  • @rajanlal137
    @rajanlal137 Жыл бұрын

    Very nice, it's really helpful.. Thanks a lot...

  • @WiseOwlTutorials

    @WiseOwlTutorials

    Жыл бұрын

    You're welcome, thanks for watching!

  • @krn14242
    @krn142423 жыл бұрын

    Thanks Andrew. Love the FIND/FIND NEXT

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    Cheers Kevin, glad you liked it!

  • @AmitSharma-po1zb
    @AmitSharma-po1zb3 жыл бұрын

    Thanks a ton Andrew for highlighting me ☺️..May the viewers have another part to this video which will show how to then auto fill the data of the respective columns in the blank cells below of each column after the rows are created with the individual strings..I suppose that will be a super informative as well..Kudos to your great work and in-depth knowledge..👍👌

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    You're very welcome Amit, thank you for the question! I'll add the second part of your question to the list but it may be some time before I get around to covering that in a new video. Happy to hear that you like this one and thank you for your support!

  • @AmitSharma-po1zb

    @AmitSharma-po1zb

    3 жыл бұрын

    Thanks a ton to you Andrew for acknowledging our queries..👍👌😊

  • @jjewel6812

    @jjewel6812

    Жыл бұрын

    I was wondering if you got the solution of your question about the auto fill???

  • @AmitSharma-po1zb

    @AmitSharma-po1zb

    Жыл бұрын

    @@jjewel6812 yes I did

  • @jjewel6812

    @jjewel6812

    Жыл бұрын

    @@AmitSharma-po1zb Could you provide me with the code? I am workin on a similar thing. Would be very grateful

  • @udani301
    @udani3012 жыл бұрын

    Thank you very much Andrew! Useful as always! Found the answer for what i have been looking for..pls keep up the good work☺️👍🏻

  • @WiseOwlTutorials

    @WiseOwlTutorials

    2 жыл бұрын

    Excellent! Happy to hear that the video helped and thank you for watching!

  • @KhalilYasser
    @KhalilYasser3 жыл бұрын

    Thank you very much. Awesome and amazing.

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    You're very welcome Yasser!

  • @inamhassan2015
    @inamhassan20152 жыл бұрын

    Thank you awsome solution

  • @WiseOwlTutorials

    @WiseOwlTutorials

    2 жыл бұрын

    You're very welcome Inam!

  • @frikduplessis8849
    @frikduplessis88493 жыл бұрын

    Thank you Andrew what an great example, this is a split function on steroids 😀👏👏

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    😀 thanks Frik! Glad you enjoyed that one!

  • @prasadpimpale4698
    @prasadpimpale46983 жыл бұрын

    Awesome video 👍.. Thank you bro!

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    You're welcome Prasad, glad you enjoyed it!

  • @rajeshmajumdar4999
    @rajeshmajumdar49993 жыл бұрын

    Thank you

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    You're welcome Rajesh, thank you for watching!

  • @pannerselvammaruthachalam825
    @pannerselvammaruthachalam8253 жыл бұрын

    Great 👍

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    Thanks Panner!

  • @RRakshithR
    @RRakshithR10 ай бұрын

    Thanks alot Andrew, your explaination really helped in solving my problem. Can you also help for the problem statement - "if column rank and Year data also needs to be updated for the rows that are divided from original row". Thanks in advance.

  • @jillanis1907
    @jillanis19073 жыл бұрын

    Thanks you so much this is much needed one, can you please tell me how to split with multiple criteria for example instead of “/” with array like (“+”, ”-”, ”*”, ”/”)

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    Hi Jillani! There's a nice discussion of this topic here with a few different solutions stackoverflow.com/questions/7680490/how-to-split-a-string-with-multiple-delimiters-in-vba-excel It seems like the easiest approach is to use the Replace function to convert all of the delimiters into the same character and then use the Split function using the one delimiter character you have left. I hope that helps!

  • @serenahu4602
    @serenahu46022 жыл бұрын

    Thanks for this. But after the split, if I want to copy the other columns e.g. title into the newly inserted row, how to do?

  • @PankajNegi007
    @PankajNegi0073 жыл бұрын

    Great Andre Sir, I enjoy another training session on VBA which is Masterpiece. Sir a humble request to you 'what is the best way to use any formulas/Functions in Excel using VBA with Loop Like Vlookup/Countifs/Sumifs etc. [when i want to use these functions I record.]

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    Thank you Pankaj! If you want to use Excel functions in your code you can use the WorksheetFunction object. You can see a full list of which functions it supports here docs.microsoft.com/en-us/office/vba/api/excel.worksheetfunction and there are links to the specifics for each function such as this one for VLookup docs.microsoft.com/en-us/office/vba/api/excel.worksheetfunction.vlookup I hope that helps!

  • @PankajNegi007

    @PankajNegi007

    3 жыл бұрын

    @@WiseOwlTutorials thanks Sir for prompt Reply

  • @deepali8939
    @deepali89392 жыл бұрын

    hey, if i want to split the text and also the entire row will lso be copied i.e. action and adventure will also have rank, title, worldwide gross,year same as science fiction(row1). Please Help me with this.

  • @montezuma7971
    @montezuma79714 ай бұрын

    How would this work with a character limit instead of a symbol?

  • @vineetat2
    @vineetat23 жыл бұрын

    Hi Andrew, Can you record your VBA trainings once again since we have Ms 365 now. I hope this will help you and your students like me 😊

  • @WiseOwlTutorials

    @WiseOwlTutorials

    3 жыл бұрын

    Hi Vineet! Thanks for the suggestion. We have updated versions of the basic VBA videos which you can find in this playlist kzread.info/head/PLNIs-AWhQzckV9rAM3yv8ym4pioIMA0UR It's very unlikely that we'll remake all our VBA videos because 1) the VBA code in the older videos still works in modern versions of Excel, and 2) we have hundreds of VBA videos and it would take a huge amount of time to remake them which would prevent us from making new content.

  • @vineetat2

    @vineetat2

    3 жыл бұрын

    @@WiseOwlTutorials That's Great. Thanks.

  • @akshaay2507
    @akshaay25072 жыл бұрын

    Thanks a lot, very helpful. Could you please provide the code ? Thanks.

  • @WiseOwlTutorials

    @WiseOwlTutorials

    2 жыл бұрын

    Hi! Check the video description!

  • @flyer23ful
    @flyer23ful2 жыл бұрын

    what if the "/" changes into "alt+enter"? Can you please solve that?

  • @viniciusmartins5409

    @viniciusmartins5409

    2 жыл бұрын

    Chr(10)

  • @queenb5029
    @queenb50292 жыл бұрын

    How do I get the vba code?

  • @WiseOwlTutorials

    @WiseOwlTutorials

    2 жыл бұрын

    Hi! There's a link in the video description, I hope it helps!