#1
|
|||
|
|||
Userform textboxes
Hi everyone
I have been looking for a solution for my problem for the last 6 hours by googling and what not and still i cant find any solution so im trying my luck here. Ive made an template to fill out dividers for physical folders, where press a button and user form pops up where i can fill out my data, which then is being inserted in tables with bookmarks, so far so good, now one of my colleagues (this is Work related) wanted to be able to highlight the text in the textboxes and then copy paste it into another textbox and fill out the values past the one you past into first....(kinda hard to explain as English isnt my native language so bare with me). Like in tables when you want to move everything one place Down you hightlight everything place the cursor in the table you wanna start in and the paste and the rest of the tables gets filled out. But i cant seem to find any options to hightlight text in multiple textboxes sooo I was considering a button called move up and a button called move Down and when you press the move Down all text gets moved to the textbox below and the rest of the text in the other boxes gets filled out after that. IVe tried this code but cant get it to Work https://www.mrexcel.com/forum/excel-...m-up-down.html ive then tried something along the line with replace text from textboxX to textboxY but it doesnt quiet Work as i want it to, so i was hoping anyone in here could point me in the right direction. FYI im totally new to VBA, and everything ive made has been codes ive found around the web and somehow put it together to make it Work (pure luck if you ask me). If description is confusing i can make som screenshots of what i want or even upload my template if needed, thanks in advance |
#2
|
||||
|
||||
If you want multiple copies, simply add a field to your userform that allows the user to specify the number of copies, then have your code create as many as needed. Either way, there is no need to select (highlight) anything; it can all be done by referencing the table and/or cells concerned. Without seeing your document & userform, though, it's impossible to be more specific.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thats a great idea and i think that could work..
let me show you what i mean. And either with highlighting or push of a button or something along the lines i want to be able to insert like this So that i can push something in between the boxes. What i do now is cut/paste from one text box to another how would an example of a code look like with want you mentioned? My text boxes are name Textbox 1-how many there are. On screenshots the 2 texboxes on the left are name Textbox1 and Textbox2. The boxes on the right stated with numbers are named Textbox3 (the big one) and textbox4 (the small one) and so forth. So the code could be like cut/paste from textbox3 to textbox5 and textbox 4 to textbox6 or maybe it should be on focus so if i put my mouse on text box 7 it moves from there and downwards.....not sure how this can actually work out |
#4
|
||||
|
||||
As I said in my previous reply:
Screenshots aren't particularly helpful substitutes.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Ive uploaded the file
|
#6
|
||||
|
||||
So what, exactly, do you want to replicate? From post #3, it seems you want to make multiple copies of Station 4, but I can't see what logic would lie behind the replicas becoming Station 4.5 & Station 4.6, instead of more exact copies of Station 4.
PS: FWIW, all your bookmarks are unnecessary - you can work with each cell directly by its address in the table.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
ohh i wasnt aware of that with the bookmarks how do i addresss a cell?
ok here is an example, lets say i fill out the whole page, from 1 to 10 but then i realize that i need to move everything from 6 and forward down 2 places so i can fill in 6 and 7 with new information but the information from that were in 6 and forward to begin with should move to 8 and just fill out what ever was beyond 6 so that the fields between 6 and 8 becomes blank so i can fill out the missing information......wonder if it makes sense.... But thats just one example i was looking for a way where i can move what ever around once its filled out. Just like if you wanna move information around in normal table with cut/paste.... The file i uploaded have 31 "rows" i can fill out, problem comes when i fill out row 1 to 25 but i realise that i forgot something in row 4, so i need that row to cut/paste everything from that row to the next row (5) so row 4 becomes blank but the date just moves forward so the last row will become row 26 |
#8
|
||||
|
||||
Try the attached.
Note that you can either use the form for moving the data so you can insert rows, or you can do it in the table directly, since there are now no bookmarks to be concerned about.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
Truly amazing job, exactly what i was looking for, and now my userform Works even better without bookmarks i cant thank you enough.
Out of pure curiosity, would it be possible to reverse the new code as well? so instead moving it all Down it could be moved upwards? |
#10
|
||||
|
||||
Yes, that would be possible, but the likely result would be to delete some existing content. Do note that you can make such edits quite easily in the document itself.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
Hmm yeah makes sense, once Again thanks for you help and time
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Update Userform Captions, TextBoxes, Command buttons From Excel | dan88 | Word VBA | 3 | 05-22-2016 08:59 AM |
Userform calls other userform, then populate worksheet | Lehoi | Excel Programming | 0 | 02-03-2016 02:58 PM |
VBA Code in a UserForm module to delete a Command Button which opens the userform | Simoninparis | Word VBA | 2 | 09-21-2014 03:50 AM |
UserForm Search with multiple TextBoxes | johndough | Excel Programming | 0 | 05-10-2014 12:11 PM |
Many textboxes on top of each others? | Giygas | PowerPoint | 1 | 12-05-2010 02:59 PM |