Skip to content

RaeAllen.net

  • Photos
  • Video
  • Presentations
  • About

  • Split data into multiple Excel worksheets based on column with VBA code

    I regularly get a block of data with 45 different entries in the first collum, repeated for each time a month appears in column 2. I wanted to split the data based on column value quickly and automatically

    The following VBA code from extendoffice.com worked well

    1. Open the Microsoft Visual Basic for Applications window. I used the Developer > Visual Basic commands from the toolbar

    2. Click Insert > Module, and paste the following code in the Module Window.

    Sub parse_data()
    Dim lr As Long
    Dim ws As Worksheet
    Dim vcol, i As Integer
    Dim icol As Long
    Dim myarr As Variant
    Dim title As String
    Dim titlerow As Integer
    vcol = 1
    Set ws = Sheets(“Sheet1”)
    lr = ws.Cells(ws.Rows.Count, vcol).End(xlUp).Row
    title = “A1:C1”
    titlerow = ws.Range(title).Cells(1).Row
    icol = ws.Columns.Count
    ws.Cells(1, icol) = “Unique”
    For i = 2 To lr
    On Error Resume Next
    If ws.Cells(i, vcol) “” And Application.WorksheetFunction.Match(ws.Cells(i, vcol), ws.Columns(icol), 0) = 0 Then
    ws.Cells(ws.Rows.Count, icol).End(xlUp).Offset(1) = ws.Cells(i, vcol)
    End If
    Next
    myarr = Application.WorksheetFunction.Transpose(ws.Columns(icol).SpecialCells(xlCellTypeConstants))
    ws.Columns(icol).Clear
    For i = 2 To UBound(myarr)
    ws.Range(title).AutoFilter field:=vcol, Criteria1:=myarr(i) & “”
    If Not Evaluate(“=ISREF(‘” & myarr(i) & “‘!A1)”) Then
    Sheets.Add(after:=Worksheets(Worksheets.Count)).Name = myarr(i) & “”
    Else
    Sheets(myarr(i) & “”).Move after:=Worksheets(Worksheets.Count)
    End If
    ws.Range(“A” & titlerow & “:A” & lr).EntireRow.Copy Sheets(myarr(i) & “”).Range(“A1”)
    Sheets(myarr(i) & “”).Columns.AutoFit
    Next
    ws.AutoFilterMode = False
    ws.Activate
    End Sub

    Note: In the above code:

    vcol =1, the number 1 is the column number that you want to split the data based on.
    Set ws = Sheets(“Sheet1”), Sheet1 is the sheet name that you want to apply this code.
    title = “A1:C1”, A1:C1 is the range of the title.
    All of them are variables, you can change them as your need.

    3. Then press F5 key to run the code, all data in the active worksheet are split into multiple worksheets by the column value. And the split worksheets are named with the split cell names.

    Note: The split worksheets are placed in the end of the workbook where the master worksheet is in.

    07/07/2016
  • Spreadsheet formulas: Prepend by concatenation

    Have had to delve into some formulas for processing text files so needed someplace to jot them down

    Prepend the word GET and a space to front of a string by the concatenation method
    =CONCATENATE(“GET “,B1)

    29/06/2016
  • Parse RSS feed with Google feed api

    This is a fully commented method parsing a mediarss feed using the now deprecated Google Feed api

    litn

    http://www.abc.net.au/landline/test/news-rss/

    <html>
    <head>
    <!–load the google javascript api – now depricated–>
    <script type=”text/javascript” src=”https://www.google.com/jsapi”></script>
    <script type=”text/javascript”>

    google.load(“feeds”, “1”);

    function initialize() {
    //load the rss feed
    var feed = new google.feeds.Feed(“http://www.abc.net.au/news/feed/7234284/rss.xml”);
    //set the number of entreies you want from the feed
    feed.setNumEntries(10);
    //load the results
    feed.load(function(result) {
    if (!result.error) {
    //look for the container div
    var container = document.getElementById(“feed”);
    //inside the container div creat a ul element
    var ul = document.createElement(“ul”);
    for (var i = 0; i < result.feed.entries.length; i++) {
    var entry = result.feed.entries[i];
    var li = document.createElement(‘li’);
    //for each item, appent an li element to the ul
    ul.appendChild(li);
    //creat and anchor element
    var a = document.createElement(‘a’);
    //give the anchor element the href attribute and the value of the entry link
    a.setAttribute(“href”, (entry.link));
    //append that anchor as a child of the li element
    li.appendChild(a);
    //append the entry title as a chiled of the anchor tag
    a.appendChild(document.createTextNode(entry.title));
    //finish by ending the ul tag inside the container
    container.appendChild(ul);
    }
    }
    });
    }
    google.setOnLoadCallback(initialize);

    </script>
    </head>
    <body>
    <div id=”feed”></div>
    </body>
    </html>

    10/03/2016
  • Rae Allen gave 5 stars to: The Chronicles of Benjamin Jamison

    Rae Allen reviewed:

    The Chronicles of Benjamin Jamison: Call Sign Reaper (Book 1) by Thomas Wright

    the Benjamin Jamison series is a great addition to your library, February 11, 2016
    Verified Purchase(What’s this?)
    This review is from: The Chronicles of Benjamin Jamison: Call Sign Reaper (Book 1) (Kindle Edition)
    For fans of military sci-fi, the Benjamin Jamison series is a great addition to your library. A well presented character as the centre piece but with a supporting cast which are strong in their own right.

    from Customer reviews on Amazon http://amzn.to/1TgfgWF
    via IFTTT

    13/02/2016
  • Rae Allen gave 5 stars to: Pirate Rage (The Federation Reborn Book 2)

    Rae Allen reviewed:

    Pirate Rage (The Federation Reborn Book 2) by Chris Hechtl

    A step forward, January 24, 2016
    Verified Purchase(What’s this?)
    This review is from: Pirate Rage (The Federation Reborn Book 2) (Kindle Edition)
    Less engineer and more military sci-fi, the ongoing story of rebuilding the Federation under pressure from a pirate empire continues to impress.

    from Customer reviews on Amazon http://amzn.to/1NtLp4Q
    via IFTTT

    25/01/2016
  • Protected: Florence Violet Rae Allen oral history

    This content is password protected. To view it please enter your password below:

    01/12/2015
  • Mud and mangroves

    Friday Journal was a radio documentary spot at 1pm  on a Friday afternoon.

    I found this one about mangrove research in FNQ on cassette recently – from about 1982

    https://www.raeallen.net/blog/wp-content/uploads/2015/11/mud-and-magroves-friday-journal.mp3?_=1
    30/11/2015
  • Men and Cattle: history of development in northern Australia

    I found a collection of small audio documentaries recently. They were on cassette so the quality after 30 odd years isn’t great. The talent is historian Peter Forrest.

    Men and Cattle is a history of development  of the cattle industry in northern Austraia but touches on a lot of other themes.

    Part one: The Overlanders

    https://www.raeallen.net/blog/wp-content/uploads/2015/11/men-and-cattle-the-overlanders-01.mp3?_=2

    Part two: The Journeys Back

    https://www.raeallen.net/blog/wp-content/uploads/2015/11/men-and-cattle-the-journeys-back-02.mp3?_=3

    Part three: Settlement Creek

    https://www.raeallen.net/blog/wp-content/uploads/2015/11/men-and-cattle-settlement-creek-03.mp3?_=4

    Part four: The journey west from the Queensland border

    https://www.raeallen.net/blog/wp-content/uploads/2015/11/men-and-cattle-across-the-border-from-qld-04.mp3?_=5

    Part five: Life on the trail

    https://www.raeallen.net/blog/wp-content/uploads/2015/11/men-and-cattle-on-the-trail-05.mp3?_=6
    30/11/2015
  • Rae Allen gave 4 stars to: Agent Hill Omnibus

    Rae Allen reviewed:

    Agent Hill Omnibus by James Hunt

    Good premise, well executed, November 22, 2015
    Verified Purchase(What’s this?)
    This review is from: Agent Hill Omnibus (Kindle Edition)
    While there is something familiar about the Agent Hill storyline this is not necessarily a bad thing. As female super agents go, Agent Hill is human enough to balance the high tech gadgetry and the enhanced biology

    from Customer reviews on Amazon http://amzn.to/1N2nmtQ
    via IFTTT

    23/11/2015
  • Tech Talk: Archival audio from the 90s

    In the early 90s I was doing a regular technology spot networked across Local Radio stations.  This is a  collection of archival audio of that content
    In the early 90s I was doing a regular technology spot networked across Local Radio stations.  This is a  collection of archival audio of that content

    1. Personal Information Managers – an interview with Glenn Rees the editor of Australian PC User magazinehttps://www.raeallen.net/blog/wp-content/uploads/2015/11/personal-information-managers.mp3?_=7
    2. CD ebooks – interview with Marius Coomans about the benefits of providing books in electronic format on CDhttps://www.raeallen.net/blog/wp-content/uploads/2015/11/CD-ebooks.mp3?_=8
    3. Pegasus network – inteview with Paul Wilson of Pegasus about the benefits of being able to network directly with the experts onlinehttps://www.raeallen.net/blog/wp-content/uploads/2015/11/pegasus-network.mp3?_=9
    4. Courtroom graphics – interview with Michael Gigante of RMIT about how computer animation and graphics could help explain complex legal issues in courthttps://www.raeallen.net/blog/wp-content/uploads/2015/11/courtroom-graphics.mp3?_=10
    5. EDI Post – interview with Bub Ludlow of Australia post about a system of sending mail by sending it from your computer to the nearest Australia post office to the recipient, from where AusPost would print it out and deliver it in the normal way. (before email)https://www.raeallen.net/blog/wp-content/uploads/2015/11/edi-post.mp3?_=11
    6. Australianised software – an interview with Alex Merrifield of Intuit about having software that doesn’t just use US formats for things like dates.https://www.raeallen.net/blog/wp-content/uploads/2015/11/australianised-software.mp3?_=12
    7. Computer phobia – an interview with author, John Kugelhttps://www.raeallen.net/blog/wp-content/uploads/2015/11/computer-phobia.mp3?_=13
    8. Personal organisers – and interview with Jackie Begbie of Sharp Corporationhttps://www.raeallen.net/blog/wp-content/uploads/2015/11/personal-organisers.mp3?_=14
    9. ISYS – text retrieval software – an interview with Odessey Software’s Mark Reisshttps://www.raeallen.net/blog/wp-content/uploads/2015/11/text-retrieval-software.mp3?_=15
    10. Windows 3.11 launchedhttps://www.raeallen.net/blog/wp-content/uploads/2015/11/windows-3-11.mp3?_=16
    11. Uniloc anti-piracyhttps://www.raeallen.net/blog/wp-content/uploads/2015/11/uniloc-tech-talk.mp3?_=17
    12. Transparent drug and alcohol information libraryhttps://www.raeallen.net/blog/wp-content/uploads/2015/11/transparent-library.mp3?_=18
    13. Information Kioskshttps://www.raeallen.net/blog/wp-content/uploads/2015/11/information-kiosk-tech-talk.mp3?_=19
    14. Mobile Computinghttps://www.raeallen.net/blog/wp-content/uploads/2015/12/mobile-computing-tech-talk.mp3?_=20
    15. Digital video productionshttps://www.raeallen.net/blog/wp-content/uploads/2015/12/digital-video-productions-tech-talk.mp3?_=21
    16. CSIRO interactive insect CDROMhttps://www.raeallen.net/blog/wp-content/uploads/2015/12/csiro-insect-cd-tech-talk.mp3?_=22
    17. Computer bankinghttps://www.raeallen.net/blog/wp-content/uploads/2015/12/computer-banking-tech-talk.mp3?_=23
    18. Newsagents selling CD softwarehttps://www.raeallen.net/blog/wp-content/uploads/2015/12/cdroms-newagents-tech-talk.mp3?_=24
    19. Using softaware to design your house yourselfhttps://www.raeallen.net/blog/wp-content/uploads/2015/12/design-a-house-tech-talk.mp3?_=25
    20. Using software to organise the office footy tippinghttps://www.raeallen.net/blog/wp-content/uploads/2015/12/footy-tipping-tech-talk.mp3?_=26
    21. Putting job ads onlinehttps://www.raeallen.net/blog/wp-content/uploads/2015/12/putting-jobs-online-tech-talk.mp3?_=27
    22. Interactive video CD’shttps://www.raeallen.net/blog/wp-content/uploads/2015/12/interactive-video-CD-tech-talk.mp3?_=28
    23. Nurses using mobile Computinghttps://www.raeallen.net/blog/wp-content/uploads/2015/12/computer-nurses-tech-talk.mp3?_=29
    24. Global Ipswich sets up city as tech centrehttps://www.raeallen.net/blog/wp-content/uploads/2015/12/global-ipswich-tech-talk.mp3?_=30
    25. Baby Oil search algorithmshttps://www.raeallen.net/blog/wp-content/uploads/2015/12/baby-oil-tech-talk.mp3?_=31
    26. Kids and Computinghttps://www.raeallen.net/blog/wp-content/uploads/2015/12/kids-stuff-tech-talk.mp3?_=32
    27. The new Intel pentium chip releasedhttps://www.raeallen.net/blog/wp-content/uploads/2015/12/intel-pentium-released-tech-talk.mp3?_=33
    28. The business model of Dell Computershttps://www.raeallen.net/blog/wp-content/uploads/2015/12/dell-computers-business-model-tech-talk.mp3?_=34
    29. Apples vision for computing is partnershipshttps://www.raeallen.net/blog/wp-content/uploads/2015/12/apples-vision-techtalk.mp3?_=35
    30. Nomadic Computinghttps://www.raeallen.net/blog/wp-content/uploads/2015/12/nomadic-computing-tech-talk.mp3?_=36
    14/11/2015
←Previous Page
1 2 3 4 5 6 … 69
Next Page→

Search

Social

Facebook

Instagram

Twitter

Categories
  • ABC-TV
  • anon sayings
  • audio
  • australian
  • Berlin
  • development
  • drama
  • flickr
  • g+
  • HTML5
  • Interesting Articles
  • koan
  • lyrics
  • Manuals
  • minutiae
  • music
  • obits
  • photo
  • poetry
  • portolio
  • presentation
  • quote
  • reading
  • recipe
  • sci-fi
  • social
  • soup
  • spreadsheets
  • Street Art
  • training
  • Travel
  • trivia
  • tv
  • Uncategorized
  • video
  • wandering
  • work
  • xssi
  • zen

RaeAllen.net

Proudly powered by WordPress