Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2024, 08:05 AM
ccice1221 ccice1221 is offline Command Button to duplicate a row in a table Windows 10 Command Button to duplicate a row in a table Office 2021
Novice
Command Button to duplicate a row in a table
 
Join Date: Jan 2024
Posts: 2
ccice1221 is on a distinguished road
Default Command Button to duplicate a row in a table

Hi All!

To be very transparent I know very little to nothing about how macros and codes work on Word and I have just been starting to use and play around with them within a document I am creating. I have mostly just been copying and pasting generalized codes with my inputs.

I have coded a table to have multi-level drop-downs to answer questions and I want to add a command button that will copy the same drop-down scenario to a row inserted directly below the previous one. Is this possible via a command button? I have also created the row I want as a bookmark I just do not know how to write the code.

Apologies if this is confusing or cannot be done this is my first post here but hoping you might be able to help.

Thank you!
Reply With Quote
  #2  
Old 01-22-2024, 09:12 AM
Italophile Italophile is online now Command Button to duplicate a row in a table Windows 11 Command Button to duplicate a row in a table Office 2021
Expert
 
Join Date: Mar 2022
Posts: 338
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Depending on how the contents of the row are configured a repeating section content control, which wouldn’t require any code, may work
Reply With Quote
  #3  
Old 01-22-2024, 12:51 PM
ccice1221 ccice1221 is offline Command Button to duplicate a row in a table Windows 10 Command Button to duplicate a row in a table Office 2021
Novice
Command Button to duplicate a row in a table
 
Join Date: Jan 2024
Posts: 2
ccice1221 is on a distinguished road
Default update

Hi also adding this attachment, unfortunately, I can't add the real details because it is for work and I cannot share but this is set up almost identically with the type of macros I have now, I am looking to add a button under the 2nd row that will create the same information in the drop downs. hopefully this helps

Thank you!
Attached Files
File Type: docm Example.docm (22.0 KB, 1 views)
Reply With Quote
  #4  
Old 01-22-2024, 01:36 PM
Italophile Italophile is online now Command Button to duplicate a row in a table Windows 11 Command Button to duplicate a row in a table Office 2021
Expert
 
Join Date: Mar 2022
Posts: 338
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

A repeating section content control may work. However, you would do better by using combo box content controls instead of form fields.

Whichever you use you will be faced with a problem - you will have controls with duplicate names, which will make coding difficult.
Reply With Quote
  #5  
Old 01-22-2024, 02:33 PM
macropod's Avatar
macropod macropod is offline Command Button to duplicate a row in a table Windows 10 Command Button to duplicate a row in a table Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See:

Adding a new row to a table in a document with formfields:
https://www.msofficeforums.com/word-...html#post38312

Adding a new row to a table in a document with content controls:
https://www.msofficeforums.com/word-...html#post87989
https://www.msofficeforums.com/word-...html#post38461
https://www.msofficeforums.com/word-...tml#post145675

Neither approach requires the use of a command button - which can of itself be problematic.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command button. To multi command Taylormations Word VBA 11 09-14-2020 02:39 AM
Show table list by using chek box command and save document on sharepoint by using command button Zhibek Word VBA 3 08-16-2018 06:19 PM
Help with a Command Button dkohnken Word VBA 5 03-18-2015 10:13 PM
Command Button knp11 PowerPoint 2 01-18-2015 01:41 PM
Command Button to duplicate a row in a table Command Button cksm4 Word VBA 7 02-27-2011 08:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft