+ Reply to Thread
Results 1 to 1 of 1

VBA code - copy selected text, separate string text into different cells and tidy up

  1. #1
    Registered User
    Join Date
    06-25-2014
    Location
    Glasgow
    MS-Off Ver
    2010 & 2013
    Posts
    16

    VBA code - copy selected text, separate string text into different cells and tidy up

    Hi,

    Firstly I am very new to Macro’s, where I have a basic understand what the code is doing I don’t understand how to amend or add to the code that it is written. I have a macro that returns football (soccer) fixtures for me from the internet and dumps them into an excel sheet, this is what I am looking for however I would like to make a few amendments to it, I think this would be done in the tidy up sub of the macro as it appears than all the info I need is taken from the internet in the import from web sub.

    The macro has been set up to return the date, the fixture and time in three columns, however there has been an amendment (probably to the internet page where the fixtures are taken from since the macro was first written) and it doesn't return the date now in the first column. I would like to change the macro to read the date in the first row, then return a blank row then split fixture over three columns, ie Home Team vs. Away Team and the fixture Time, and repeat this for all the fixtures on the page.

    I think that before the ‘delete the first column instruction on Ln 56 part of the macro, I would need to add the following to get what I am looking for:

    Search column A where it returns the first section of data that includes the date, delete all text except numbers 1-31 and the months of the year then copy this across to (say) column C before deleting the column A, however I am unsure if that’s the best way to retrieve the date or not. I would also like the text "Match Day" then the number 01, 02, 03 etc added to the cell directly before the date, i.e. cell B6 in the example I have attached.

    Then split the text string for the fixtures from one column into three separate columns as I mention above, this will require two new columns to be inserted between the returned fixtures and fixture time with home team in the first (original) column, the text “vs” in the second column and away team in the third column. With this I'm not sure if it is best to provide a list of the teams that play so a rule can be set up or just to split it either side of the “V” that is included in the text string, my only concern with that is if there is a team name with a “V” in the name it could cause an issue. If the best option is to provide a list and set up a rule then it would be useful to be able to set this up as a cell in the data worksheet as the list of teams will change every year.

    I appreciate that I am maybe asking more than I realise however if someone could help me out with this I would be greatly appreciate it. I have uploaded and example workbook with both what the macro returns just now and what ideally I would like to see returned. The example that I have uploaded is for the European Cup Qualifying fixtures however I will use this for domestic fixtures however the fixtures for not season have not been released yet.

    The worksheet Euro Championship is what is returned when the full macro is run, the worksheet Euro Championship_A is returned when I stop it before Ln 56 and the third worksheet fixtures is what I would like to be returned from the macro. I have only shown the first 4 blocks of fixtures in my manual creation rather than all fixtures on the page as it was to show the format I was looking for.

    Hopefully I have covered everything that is needed to allow someone to help me out, however if I've missed something please let me know.

    Thanks,
    EMcK
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 03-21-2015, 04:14 AM
  2. Replies: 2
    Last Post: 04-09-2014, 11:48 AM
  3. [SOLVED] Dividing string text into separate cells
    By stinkstik in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-25-2013, 08:08 PM
  4. [SOLVED] switch text string with comma separator into separate cells
    By petrasimonova in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-17-2013, 07:40 AM
  5. Separate out a text string in one cell, and break into into individual cells
    By StephenHall in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-05-2012, 03:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1