Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2017, 02:27 AM
Guimenez Guimenez is offline Add field based on excel data with keyboard shortcut Windows 10 Add field based on excel data with keyboard shortcut Office 2013
Advanced Beginner
Add field based on excel data with keyboard shortcut
 
Join Date: Jan 2017
Posts: 33
Guimenez is on a distinguished road
Default Add field based on excel data with keyboard shortcut

Hi,
is it possible to create a keyboard shortcut to add a field based on a excel columm and then choose the info i want with a dropdown?

Every day a make documents with lots of names and numbers, ex:

peter n.º1234
John n.º4321


Hector n.3333

If i can simplify my live using a keyboard shortcut to add the field and choose the name i want it will be amazing.

thanks
Reply With Quote
  #2  
Old 01-04-2017, 03:38 AM
macropod's Avatar
macropod macropod is offline Add field based on excel data with keyboard shortcut Windows 7 64bit Add field based on excel data with keyboard shortcut Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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, for example: https://www.msofficeforums.com/word-...html#post46287
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-04-2017, 03:59 AM
Guimenez Guimenez is offline Add field based on excel data with keyboard shortcut Windows 10 Add field based on excel data with keyboard shortcut Office 2013
Advanced Beginner
Add field based on excel data with keyboard shortcut
 
Join Date: Jan 2017
Posts: 33
Guimenez is on a distinguished road
Default Populate Dropdown List from Excel

Hi,
i'm trying to do the same thing as in https://www.msofficeforums.com/word-...drop-down.html but without sucess.
i've created the excel file wiht lots of names in the first columm.
I've created the macro and paste the code on the #2 post and set the reference in the macro.
Now how can i call the macro to show me the dropdown with the list of excel file?
Thank you
Reply With Quote
  #4  
Old 01-04-2017, 04:53 AM
macropod's Avatar
macropod macropod is offline Add field based on excel data with keyboard shortcut Windows 7 64bit Add field based on excel data with keyboard shortcut Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

I take it you added the macro to the Word document, not to the Excel workbook. The macro runs automatically when you open the document - no user action is required. For it to work with the macro as coded, though, your Word document must have a dropdown content control titled 'ID' - though you could use a different title (provided you use the same title in the document and in the code). Note also that the macro looks for a workbook named 'Workbook Name' (of all things) in your 'Documents' folder. You can change both the filename and folder.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-04-2017, 05:12 AM
Guimenez Guimenez is offline Add field based on excel data with keyboard shortcut Windows 10 Add field based on excel data with keyboard shortcut Office 2013
Advanced Beginner
Add field based on excel data with keyboard shortcut
 
Join Date: Jan 2017
Posts: 33
Guimenez is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
I take it you added the macro to the Word document, not to the Excel workbook. The macro runs automatically when you open the document - no user action is required. For it to work with the macro as coded, though, your Word document must have a dropdown content control titled 'ID' - though you could use a different title (provided you use the same title in the document and in the code). Note also that the macro looks for a workbook named 'Workbook Name' (of all things) in your 'Documents' folder. You can change both the filename and folder.
Thanks for replying.
This is what i did:

The files are in my documents folder and i've changed the location on the macro
- created excel file (xlsx) and put in the first columm 10 names
- created doc file and went to macros, create new and past the code above, changing the StrWkBkNm to match my file.
- created a new dropdown and titled it "ID".

But nothing happens, i've close the document and open again the dropdown "ID" is empty.

Do you know what i'm doing wrong? I need it a lot.
Thanks
Reply With Quote
  #6  
Old 01-04-2017, 12:06 PM
macropod's Avatar
macropod macropod is offline Add field based on excel data with keyboard shortcut Windows 7 64bit Add field based on excel data with keyboard shortcut Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Can you attach a document (including your modified copy of the macro) to a post (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 01-05-2017, 01:10 AM
Guimenez Guimenez is offline Add field based on excel data with keyboard shortcut Windows 10 Add field based on excel data with keyboard shortcut Office 2013
Advanced Beginner
Add field based on excel data with keyboard shortcut
 
Join Date: Jan 2017
Posts: 33
Guimenez is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Can you attach a document (including your modified copy of the macro) to a post (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
Thank you for trying to help me

I've attached my 2 files.
Is it possible to make a macro that when i press F8 it will show the dropdown to select the names?

thank you once again.
Attached Files
File Type: docx dados.docx (18.8 KB, 8 views)
File Type: xlsx dados.xlsx (9.3 KB, 9 views)
Reply With Quote
  #8  
Old 01-05-2017, 02:23 AM
macropod's Avatar
macropod macropod is offline Add field based on excel data with keyboard shortcut Windows 7 64bit Add field based on excel data with keyboard shortcut Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

As the document you attached is in the docx format, it cannot contain a macro. Accordingly, it is not possible for me to see what you have done with the code.

Regardless, try the attached. I have adapted the code to your workbook, plus I've added the coded needed to output the value for the selected item to a second content control.

Simply save the document to the same folder as your dados.xlsx workbook.
Attached Files
File Type: docm dados.docm (33.0 KB, 8 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 01-05-2017, 02:28 AM
Guimenez Guimenez is offline Add field based on excel data with keyboard shortcut Windows 10 Add field based on excel data with keyboard shortcut Office 2013
Advanced Beginner
Add field based on excel data with keyboard shortcut
 
Join Date: Jan 2017
Posts: 33
Guimenez is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
As the document you attached is in the docx format, it cannot contain a macro. Accordingly, it is not possible for me to see what you have done with the code.

Regardless, try the attached. I have adapted the code to your workbook, plus I've added the coded needed to output the value for the selected item to a second content control.

Simply save the document to the same folder as your dados.xlsx workbook.
I've try your file but it's the same
It appears a box but i can choose nothing.
I've attached my macro.
Thank you
Attached Files
File Type: txt macro.txt (2.0 KB, 8 views)
Reply With Quote
  #10  
Old 01-05-2017, 02:33 AM
macropod's Avatar
macropod macropod is offline Add field based on excel data with keyboard shortcut Windows 7 64bit Add field based on excel data with keyboard shortcut Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Did you try selecting anything from the dropdown after opening the document? If it's empty, that suggests you either didn't enable the macro when prompted to do so or that you have macros disabled on your Word installation.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 01-05-2017, 03:41 AM
Guimenez Guimenez is offline Add field based on excel data with keyboard shortcut Windows 10 Add field based on excel data with keyboard shortcut Office 2013
Advanced Beginner
Add field based on excel data with keyboard shortcut
 
Join Date: Jan 2017
Posts: 33
Guimenez is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Did you try selecting anything from the dropdown after opening the document? If it's empty, that suggests you either didn't enable the macro when prompted to do so or that you have macros disabled on your Word installation.
I've macros in Word.

Here you have 2 prints with what is happening.
Thanks
Attached Images
File Type: png doc1.png (37.1 KB, 19 views)
File Type: png doc2.png (37.3 KB, 19 views)
Reply With Quote
  #12  
Old 01-05-2017, 03:50 AM
macropod's Avatar
macropod macropod is offline Add field based on excel data with keyboard shortcut Windows 7 64bit Add field based on excel data with keyboard shortcut Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Well, unless you're dismissing the 'enable' option or you have an empty workbook in that folder, I cannot see how it is possible to end up with an empty list and no error messages.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #13  
Old 01-05-2017, 04:14 AM
Guimenez Guimenez is offline Add field based on excel data with keyboard shortcut Windows 10 Add field based on excel data with keyboard shortcut Office 2013
Advanced Beginner
Add field based on excel data with keyboard shortcut
 
Join Date: Jan 2017
Posts: 33
Guimenez is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Well, unless you're dismissing the 'enable' option or you have an empty workbook in that folder, I cannot see how it is possible to end up with an empty list and no error messages.
Ok, i try to edit your macro and it says that the macros in this project are disable, how can i enable please?
Reply With Quote
  #14  
Old 01-05-2017, 04:44 AM
Guimenez Guimenez is offline Add field based on excel data with keyboard shortcut Windows 10 Add field based on excel data with keyboard shortcut Office 2013
Advanced Beginner
Add field based on excel data with keyboard shortcut
 
Join Date: Jan 2017
Posts: 33
Guimenez is on a distinguished road
Default

Quote:
Originally Posted by Guimenez View Post
Ok, i try to edit your macro and it says that the macros in this project are disable, how can i enable please?
I've enabled it and it's working flawless, thank you

Please, is it possible to create an shortcut to put the 2 box after pressing it?

Ex:

Pressing F8, it will add the combox and the text area to match name+number

joao n.º123456

Thank you
Reply With Quote
  #15  
Old 01-05-2017, 04:51 AM
macropod's Avatar
macropod macropod is offline Add field based on excel data with keyboard shortcut Windows 7 64bit Add field based on excel data with keyboard shortcut Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Quote:
Originally Posted by Guimenez View Post
Please, is it possible to create an shortcut to put the 2 box after pressing it?

Ex:

Pressing F8, it will add the combox and the text area to match name+number

joao n.º123456
I have no idea what you mean. For example, pressing F8 has nothing to do with making a dropdown selection. If you want to make a dropdown selection, click on the dropdown. Nothing could be simpler and you certainly don't need a shortcut - unless you're trying to avoid using the mouse - but even then a shortcut won't make the selection for you.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add field based on excel data with keyboard shortcut Changing keyboard layout - Changing/removing keyboard shortcut Hans L Windows 2 08-16-2015 05:33 PM
keyboard shortcut ilor OneNote 1 11-13-2014 02:48 PM
disable ctrl+space excel keyboard shortcut melvinjn Excel 2 11-27-2013 04:11 AM
Add field based on excel data with keyboard shortcut Keyboard shortcut for bookmarks Jennifer Murphy Word VBA 1 01-06-2013 07:38 PM
Outlook Keyboard shortcut sostrow28 Outlook 1 12-10-2010 05:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:07 PM.


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