Consulting

Results 1 to 4 of 4

Thread: Help with VBA code in data entry form

  1. #1
    VBAX Newbie
    Joined
    Apr 2019
    Posts
    2
    Location

    Help with VBA code in data entry form

    Dears,

    I would like to kindly ask you for your help/advise regards vba code. I need to split multiple lines filled in text box to separate lines in excel after saving.So far, all info in text box saved in on excel cell - need to separate each line in text box to cells in excel.

    See attached picture, Assume it will be clear for what I'm looking for.
    Split.jpg
    btw...I'm vba beginer, so please be patient

    THX Adin 84

  2. #2
    Put this code in the submit button's Click event...
      Dim Data As Variant
      Data = Split(TextBox1.Text, vbLf)
      Range("A1").Resize(UBound(Data) + 1).Value = Application.Transpose(Data)

  3. #3
    VBAX Newbie
    Joined
    Apr 2019
    Posts
    2
    Location
    Many thanks Sir,

    seems it will be working well.
    Just need one small adjustment. I forgot to mention, that "storage" is in excel table which is located in different sheet. Now it's loading data to the same sheet where data entry interface is located.
    Need to save data in Column E in sheet called "Database"

    Any advise?

    THX
    Adin

  4. #4
    Quote Originally Posted by Adin 84 View Post
    Many thanks Sir,

    seems it will be working well.
    Just need one small adjustment. I forgot to mention, that "storage" is in excel table which is located in different sheet. Now it's loading data to the same sheet where data entry interface is located.
    Need to save data in Column E in sheet called "Database"

    Any advise?
    Change the last line of code that I gave you to this...
      Sheets("Database").Range("E1").Resize(UBound(Data) + 1).Value = Application.Transpose(Data)

Posting Permissions

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