+ Reply to Thread
Results 1 to 11 of 11

Data Paste

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    14

    Data Paste

    Hello All,

    I have an interesting question that needs some answering.

    I have a set of columns loaded with information. One of the columns has a set of information in it that relies on 5 columns. Here is an example:

    Example 1:

    Column B
    AREA:80:FORT ERIE:_TOWN_UNKNOWN:BERTIE ST

    Column E
    80

    Column H
    FORT ERIE

    Column I
    (BLANK)

    Column U
    BERTIE

    Column V
    ST

    Example 2:

    Column B
    AREA:80:FORT ERIE:_TOWN_SMALLVILLE:BLACK CREEK RD

    Column E
    80

    Column H
    FORT ERIE

    Column I
    SMALLVILLE

    Column U
    BLACK CREEK

    Column V
    RD

    Attached is a spreadsheet of what it should look like.

    Book2.xlsx

    I need the process to be automated by a macro to scan the columns and automatically input that info. into Column B with the template:

    Area:Column E:Column H:_TOWN_Column I:Column U Column V

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485

    Re: Data Paste

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Data Paste

    Not sure if this is what you are after...
    ="AREA:"&E2&":"&H2&":_"&IF(I2="","TOWN_UNKNOWN",I2)&":"&U2&" "&V2

    If not, please read what Dave said
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    11-13-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Data Paste

    Hello,

    This code will work for my applications:

    ="AREA:"&E182&":"&H182&":_"&IF(I182="","TOWN_UNKNOWN",I91)&":"&IF(U182="","STREET_UNKNOWN",U182)&" "&V182

    Thanks for the help guys/gals

    Regards,

    B

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Data Paste

    Hey FDibbins,

    I've got a little problem that I didn't notice until just recently.

    I wanted to put an "ELSE" and/or "ELSEIF" into the formula.

    Attached is the file. If you look at ROW 92 you will noticed that there is actually a street associated with the address, but the code did not capture it. I want it to capture what's in AA (Street name) and AB (Street Type), ELSE "_STREET_UNKNOWN"

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Data Paste

    I dont think the file made it?

  7. #7
    Registered User
    Join Date
    11-13-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Data Paste

    Sorry,

    I forgot the file. Here it is:
    Attached Files Attached Files

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Data Paste

    ok, you can use the method I used in my formula for all the cells, if you want to...

    ="AREA:"&E2&":"&H2&":_"&IF(I2="","TOWN_UNKNOWN",I2)&":"&U2&" "&V2

    just extend the bolded part to the other references

  9. #9
    Registered User
    Join Date
    11-13-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Data Paste

    I don't quite get the 'extend the bolded part to other references'

  10. #10
    Registered User
    Join Date
    11-13-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Data Paste

    Here is the code I will be using:

    ="AREA:"&E5&":"&H5&":_"&IF(I5="","TOWN_UNKNOWN",I5)&":"&IF(U5="","_STREET_UNKNOWN",U5)&" "&V5

    Look at Rows 5-15. There are streets associated with those addresses, the code is capturing it as _STREET_UNKNOWN. I want it to scan through Column U and Column AA, when it finds nothing it should put _STREET_UKNOWN
    Attached Files Attached Files

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Data Paste

    I meant that you use the same method I used with the IF() function for the rest of the references...

    ="AREA:"&E2&":"&H2&":_"&IF(I2="","TOWN_UNKNOWN",I2)&":"&IF(U2="","whatever the column name is_UNKNOWN",U2)&" "&IF(V2="","whatever the column name is_UNKNOWN",V2)

+ 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