+ Reply to Thread
Results 1 to 8 of 8

Insert Address data into the next row down from a user form.

  1. #1
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Insert Address data into the next row down from a user form.

    Hi Guys,

    I have populated a user from from a worksheet of address data. I want to input the data to show as an address with each line of the address appearing on the next row down. Currently I have the text boxes assigned to individual cells but that doesn't work as some addresses have 3 address lines. Please help!

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Insert Address data into the next row down from a user form.

    Can you attach a sample of your workbook with the userform and the code you are using?
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Re: Insert Address data into the next row down from a user form.

    Hi gmr4evr1, apologies for the delayed response and thanks for the help. Please find it attached
    Attached Files Attached Files

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Insert Address data into the next row down from a user form.

    Ok for some firms to have multiple address lines, but what exactly are you trying to achieve in that case ?
    On your userform you only have 1 textbox for an address line so ..... ?
    After giving it some thought I guess you want the possibility to select an address line in case of multiple addresses.
    A solution would be to change TextBox to Combobox and check for multiple address lines and add them accordingly to the Combobox.
    Does this sound plausible to you ?
    Post an example file where this situation occurs so we can work with that.
    Last edited by bakerman2; 03-15-2017 at 04:11 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Re: Insert Address data into the next row down from a user form.

    Thanks. I have attached an updated copy of what I'm working with. You will see on Sheet1 that the data now has two additional lines for addresses 'Address line2' and 'Address Line3'.
    As some addresses have more than one line; when I specify (as is currently) a specific cell for each address line. It leaves the two cells for 'Address Line2' and '3' blank and then the postcode appears two lines down.
    EG If address has only one address line
    Company XYZ
    6 Luck Lane


    Aberdeen,
    Aberdeenshire
    AB CDE

    Whereas I want it to appear as:

    Company XYZ
    6 Luck Lane
    Aberdeen,
    Aberdeenshire
    AB CDE

    And if it has two address lines like this:

    Company XYZ
    6 Luck Lane
    Lively House
    Aberdeen,
    Aberdeenshire
    AB CDE

    And not like this
    Company XYZ
    6 Luck Lane
    Lively House

    Aberdeen,
    Aberdeenshire
    AB CDE

    Please note that on the user form 'ClintInvShpInputForm' I have placed 4 hidden textboxes to capture the information.

    Thanks again.
    Attached Files Attached Files

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Insert Address data into the next row down from a user form.

    Try this.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-07-2017
    Location
    Stockport, England
    MS-Off Ver
    2007
    Posts
    91

    Re: Insert Address data into the next row down from a user form.

    Works a treat....Legend.....Thank you!

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: Insert Address data into the next row down from a user form.

    You're welcome and thanks for rep+ and feedback.

+ 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. User form to Search Data and Insert
    By magnum4u in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2017, 11:16 AM
  2. Using a user form to insert a new row
    By Maddie77 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2016, 11:55 AM
  3. Replies: 3
    Last Post: 02-14-2014, 12:23 PM
  4. VBA to Insert row & data from user form in list
    By CajunAg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2013, 06:04 PM
  5. Replies: 2
    Last Post: 03-05-2011, 12:35 PM
  6. User Form - Insert Row then Data
    By cooper1308 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-04-2009, 08:38 PM
  7. How to insert OLE chart into a user form?
    By thesaint in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-06-2005, 05:26 AM

Tags for this Thread

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