Monthly Archives: April 2015

Split excel worksheets to individual files

If we have about many sheets in excel, and save all the sheets as their own files will definitely was not about to do this by hand. it take a take time!. I found a good tips from the internet, to solve this problem,in which using the macro!.

Here the code:

Sub CreateNewWBS()
 Dim wbThis As Workbook
 Dim wbNew As Workbook
 Dim ws As Worksheet
 Dim strFilename As String
 Set wbThis = ThisWorkbook
 For Each ws In wbThis.Worksheets
 strFilename = wbThis.Path & "/" & ws.Name
 ws.Copy
 Set wbNew = ActiveWorkbook
 wbNew.SaveAs strFilename
 wbNew.Close
 Next ws
End Sub

References/Sources:

http://superuser.com/questions/561923/how-can-one-split-an-excel-xlsx-file-that-contains-multiple-sheets-into-sep

https://jen3ral.wordpress.com/2012/06/29/excel-save-worksheets-as-separate-files/

References/Sources:

Remove the last part of every line in notepad++

If we have the lines:

http://lunar.earth.northwestern.edu/mediawiki/index.php/Limitless_It_the_film_high_quality
http://sportnaslava.info/wiki/index.php?title=User:CisBlakeman861

and we want final lines become like this:

http://lunar.earth.northwestern.edu/mediawiki/index.php
http://sportnaslava.info/wiki/index.php

we can applied notepad++ to do it. The solution as follow:

1) Using notepad++ and go to the search. Please used the regular expression as search mode

2) search

index\.php.*$

index\ means search for word; .* means everything else; $ means the end of line.

3) then replace with

index.php

4) That should find everything after (and including) index.php, and replace it with just index.php.

http://lunar.earth.northwestern.edu/mediawiki/index.php
http://sportnaslava.info/wiki/index.php

References: http://superuser.com/questions/391318/how-do-i-remove-the-last-part-of-every-line-in-notepad