+ Reply to Thread
Results 1 to 6 of 6

Send data to specific range using multiple textboxes from userform

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Send data to specific range using multiple textboxes from userform

    hi,
    i am trying to send data to specific range with specific textbox, i am trying below code but its not working

    Please Login or Register  to view this content.
    i need a faster code to do this task

    thank you
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Send data to specific range using multiple textboxes from userform

    You say it's not working but then imply it is when you say it's not quick enough. Which is it?

    Is there any sort of direct relationship between the cell row numbers and the textbox number?

    Even if not I'd be inclined to create an array of the cell values and associate each textbox with the array index. So for instance E2 (I can't see an E1) would be TextBox1, the next cell which appears to be E6 would be associated with TextBox2.

    You could then use a loop and loop through the array using the loop counter to read the cell in the array which needs to carry the textbox value.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Re: Send data to specific range using multiple textboxes from userform

    Yes i said its not working, i said i need fast version because i want a working fast version. Sorry for the miss understand,
    Btw
    We can change the order of texboxes
    Like
    E2.value = textbox1
    E6.value = textbox2
    E10.value = textbox3
    E14.value = textbox4
    And continue

    Each time row difference is 4
    I mean every other texbox should send data to every forth row
    And
    Thank yoi for the reply mod

    I tried many time to do this but failed evry time

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Send data to specific range using multiple textboxes from userform

    Hi,

    Here's one approach

    Name your Textboxes 1 to 34 and in the CommandButton UserForm object (or whatever you're using to fire the macro) run the following.
    Please Login or Register  to view this content.
    It's a moot point whether you name the textboxes 1 to 34, or whether you name them the same as the cells to which their contents are destined. In which case change the macro to.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,078

    Re: Send data to specific range using multiple textboxes from userform

    Thank you Mod
    there is a little problem, otherwise code is working as i wanted,
    and the problem is ?
    i fill some value to my textboxes, textbox2, textbox6, textbox18, then only these value should send to the range, others textboxes are blank (no value input ) so ignore them only send filed textboxes value

    thank you

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

    Re: Send data to specific range using multiple textboxes from userform

    Try this.

    Please Login or Register  to view this content.
    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.

+ 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. Paste copied cell range into multiple userform textboxes
    By c00ly81 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-11-2021, 01:30 PM
  2. Copying contents of specific textboxes from one userform to another
    By Shazza-D in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2016, 11:01 AM
  3. Send data from userform to named range
    By wpryan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2015, 10:07 AM
  4. [SOLVED] From UserForm TextBoxes to specific cells on worksheet
    By ScotyB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-04-2015, 05:41 PM
  5. Search worksheet for data in multiple textboxes in userform and display in another workshe
    By SierraKilo78 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2013, 09:59 AM
  6. [SOLVED] Save and Send Userform data to a specific email address based on Combobox value
    By GAMU in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-30-2013, 01:13 PM
  7. userform with 3 comboboxes and textboxes send to sheet
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2013, 03:15 PM

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