+ Reply to Thread
Results 1 to 8 of 8

Formula to copy parts of an address in cells and paste in specific columns. - See att

  1. #1
    Registered User
    Join Date
    01-31-2012
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    7

    Formula to copy parts of an address in cells and paste in specific columns. - See att

    Hi all,

    I'm looking for a formula to copy parts of an address in cells and paste in specific columns.

    I attach a copy of a before and after (how i'd like it to look) sheet 1 - sheet 2.

    Hope someone clever out there can help me with this.

    Many Thanks

    Marc
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: Formula to copy parts of an address in cells and paste in specific columns. - See

    I don't think you will find a formula to help you. I think VBA would be the best way however there is inconsistencies with the data.
    For the first line it is no problem - you can split the value in A1 with the delimited "-"
    Example code
    Please Login or Register  to view this content.
    The problem is the 2nd and 4th row of data
    Canolfan Siopa / Shopping Centre Bettws Casnewydd / Newport NP20 6TN Ebost / Email: [email protected]
    Coldbath Road Casnewydd / Newport NP18 1NF Ebost / Email: [email protected]
    You could split this by the delimiter "/"
    Please Login or Register  to view this content.
    The problem is that in the array fLine with the 2nd row of data is that there is 4 parts. If you use the same code on the 4th line there is only 3 parts. The logic is not consistent in that to write code to separate the data in the array from the 2nd row of data there is 4 items however only 3 items in the 4th row of data. What logic could you give us to know that "Canolfan Siopa / Shopping Centre Bettws Casnewydd" gets pasted into Column C in sheet 2 however only "Coldbath Road Casnewydd" gets pasted into column C in sheet 2. Will the data that goes into sheet 2 column C always end with "dd" ? If so then that logic could be used to do the splitting of the strings and pasting into the second sheet.
    If you could give some logic to determine what part of the string gets pasted where into sheet 2 then code could be written however without some definite logic it is almost impossible. You only give 2 examples so I was unsure the "dd" was a co-incidence or a true marker of the end of a set of data.
    Hope this makes sense

    Anthony

  3. #3
    Registered User
    Join Date
    01-31-2012
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Formula to copy parts of an address in cells and paste in specific columns. - See

    Hi Anthony,

    Many thanks for that, I've had a look at all the other data i have there is no consistency what so ever.

    I shall send you something else you might be able to help me with.

  4. #4
    Registered User
    Join Date
    01-31-2012
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Formula to copy parts of an address in cells and paste in specific columns. - See

    Hi Anthony,

    Are you able to help me with this one. This is alot easier i think thant the previous one.

    I attach a copy of a before and after (how i'd like it to look) sheet 1 - sheet 2.

    Many thanks

    Marc
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Formula to copy parts of an address in cells and paste in specific columns. - See

    hi Marc, option to make it basing on the example file provided, run code "test"
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-31-2012
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Formula to copy parts of an address in cells and paste in specific columns. - See

    Hi Anton,

    Sorry I have very limited use of VB, are you able to insert the code in the document Sample data for community halls yell.

    Note - I will add more to this list as well. So the code needs to cater for more information, it will be in the same format as well.

    Your help is much appreciated.

    Marc

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Formula to copy parts of an address in cells and paste in specific columns. - See

    please check attachment, press "Get data" button
    Last edited by watersev; 02-02-2012 at 10:22 AM.

  8. #8
    Registered User
    Join Date
    01-31-2012
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Formula to copy parts of an address in cells and paste in specific columns. - See

    Faaaaaaaaaaaaantastic. Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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