+ Reply to Thread
Results 1 to 4 of 4

Delimited Text To Columns Utlizing a User Form Text Box Can't Manually Enter Data

  1. #1
    Registered User
    Join Date
    02-17-2016
    Location
    United States
    MS-Off Ver
    2007
    Posts
    11

    Delimited Text To Columns Utlizing a User Form Text Box Can't Manually Enter Data

    Hi all I am having a problem with Parse data error message when entering data manually or scanned into a user form. If I paste the same data from the clipboard it works fine. But if I try to manually enter it or scan it, I get the run time error 1004, "No Data Was Selected To Parse". It scans the data letter and digits precisely but it will not work, unless its coming from the spreadsheet/clipboard. I know its looking at selection, im sure that's where the problem lies I just dont have the know how, the macro was recorded Here is the code:

    Private Sub CommandButton1_Click()

    Selection.TextToColumns Destination:=Range("L2:M2"), DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
    Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
    :="-", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 9), Array(4, 9)), _
    TrailingMinusNumbers:=True

    End Sub

    my raw data looks like this: ELRTY10-8888753-prf-16095
    Ultimately in cell L2 "ELRTY10" and "8888753" in cell M2

    that's the reason for the text to columns to erase the rest not needed. Again Clipboard Ctrl V works but manually or scanning into the user form text box gives the error.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Delimited Text To Columns Utlizing a User Form Text Box Can't Manually Enter Data

    You can use the Split function to parse the data from a textbox control.

    Please Login or Register  to view this content.
    You'll end up with an array.

    Then use push the values to the cells.

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    02-17-2016
    Location
    United States
    MS-Off Ver
    2007
    Posts
    11

    Re: Delimited Text To Columns Utlizing a User Form Text Box Can't Manually Enter Data

    Tinbrndr, I cant even begin to tell you how much this is appreciated, ThankYou so very much. This is exactly what I needed.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Delimited Text To Columns Utlizing a User Form Text Box Can't Manually Enter Data

    I'm glad my alternate solution worked for you.

+ 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. [SOLVED] User Form with Empty row but user may enter data manually
    By Nole68 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2015, 11:35 AM
  2. Refresh form when I enter data into a text box
    By krabine in forum Access Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2015, 03:10 PM
  3. [SOLVED] Loop for text box data in USER FORM
    By Srikanth H N in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2015, 09:32 AM
  4. Replies: 1
    Last Post: 07-16-2014, 06:35 PM
  5. [SOLVED] Make user enter data into one of two text boxes in a userform
    By bberger1985 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2013, 11:39 AM
  6. Replies: 1
    Last Post: 08-28-2013, 05:04 PM
  7. Can't get User Form to collect data instead of text box
    By Kyle Mead in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2010, 02:16 AM

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