Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #31  
Old 01-11-2017, 01:57 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,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

To add more content control pairs, all you need do is run the AddControls macro - you don't need yet another macro to run that!!!

As for assigning a shortcut to the macro, see the first link in post #3 in this thread . However, I would recommend against trying to assign any pre-assigned Word shortcut keys, such as F8. Doing so can have unpredictable and undesirable effects.

To see what the pre-assigned Word shortcut keys are, visit: https://support.office.com/en-us/art...2-f762f663ceb2
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #32  
Old 01-11-2017, 04:13 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
To add more content control pairs, all you need do is run the AddControls macro - you don't need yet another macro to run that!!!

As for assigning a shortcut to the macro, see the first link in post #3 in this thread . However, I would recommend against trying to assign any pre-assigned Word shortcut keys, such as F8. Doing so can have unpredictable and undesirable effects.

To see what the pre-assigned Word shortcut keys are, visit: https://support.office.com/en-us/art...2-f762f663ceb2
In Excel if i put a name without number, when inserting the dropdown it fails with an error.

Is it possible if the name doesn't have number(columm B), it only fills the name?
Thank you
Reply With Quote
  #33  
Old 01-11-2017, 09:42 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,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

Try the attached template. Note that I've made some other changes to the code, too, so that it simply looks at the first worksheet in the workbook rather than looking for one named 'Folha1'.
Attached Files
File Type: dotm dados.dotm (37.6 KB, 7 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #34  
Old 01-12-2017, 01:32 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
Try the attached template. Note that I've made some other changes to the code, too, so that it simply looks at the first worksheet in the workbook rather than looking for one named 'Folha1'.
Hi, now it's more generic
But i'm getting the same error.
If i have names in the first columm and no number in the second columm, it stop the macro with an error.

I've attached my excel data for you try it out please.
thank you
Attached Files
File Type: xlsx dados.xlsx (9.3 KB, 10 views)
Reply With Quote
  #35  
Old 01-12-2017, 02:08 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,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

Try the attached. The problem was in having multiple blanks, which Word treats as duplicates (which aren't permitted).
Attached Files
File Type: dotm dados.dotm (37.6 KB, 9 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #36  
Old 01-12-2017, 02:13 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
Try the attached. The problem was in having multiple blanks, which Word treats as duplicates (which aren't permitted).
It's almost working
When i open, it gives me the error attchaed.
But now the names without number appears too
But when i select a name, it still gives me the error and doesn't show the number(the one how have numbers)
Thanks
Attached Images
File Type: png 1.png (6.3 KB, 10 views)
File Type: png 2.png (5.2 KB, 10 views)
File Type: png 3.png (11.5 KB, 10 views)
Reply With Quote
  #37  
Old 01-12-2017, 02:20 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,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

That error has nothing to do with any changes I made to the code (that part has remain unchanged for days) and suggests you're once again trying to do something contrary to how the code is designed to work. It is designed around being used to create one dropdown, from which an entry is selected and the controls are replaced by the text, before you create another dropdown from which an entry can be selected.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #38  
Old 01-12-2017, 02:58 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
That error has nothing to do with any changes I made to the code (that part has remain unchanged for days) and suggests you're once again trying to do something contrary to how the code is designed to work. It is designed around being used to create one dropdown, from which an entry is selected and the controls are replaced by the text, before you create another dropdown from which an entry can be selected.
You are right.
The macro is working perfectly well for the job is mean to

tell me, is it possible to modify the macro so it only insert the dropdown and read only the first columm? I don't need the second columm.

Thanks
Reply With Quote
  #39  
Old 01-12-2017, 04:58 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,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

What - you now want me to do a major re-write of the code because you've changed your mind?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #40  
Old 01-12-2017, 05:51 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
What - you now want me to do a major re-write of the code because you've changed your mind?
No sorry, it's not that.
The problem i've now it's that if i don't have nothing in Columm B, the macro stops and gives me an error.
So, since i've persons with numbers and others without numbers, i can't use the macro
I was just thinking, if i only use the columm A, i can put there names with numbers or without numbers ex:

Columm A
Joao n.º123456
Luis
Paulo 123431
Helder

In my opinion, it's more easy insert only a dropdown, select the name and keep writing. If i use the dropdown, select then i need to press mouse outside the dropdown to appear the number. That will reduce the speed of writing.
With 1 columm and 1 dropdown, after pressing enter a just need to write without pressing the mouse.


Hope you understand me now

Thanks
Reply With Quote
  #41  
Old 01-12-2017, 01:19 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,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

The last revision I made to the template works fine with or without values in column B...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #42  
Old 01-12-2017, 05:08 PM
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
The last revision I made to the template works fine with or without values in column B...
Yes,it works but i found the problem why it was not working with me.
The problem i found it's that i can't have the same name twice

Ex:
Columm A columm B
joao santos 123456
pedro 232435
joao santos
pedro
Reply With Quote
  #43  
Old 01-12-2017, 05:19 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,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

That's fairly normal...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #44  
Old 01-12-2017, 05:22 PM
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
That's fairly normal...
There's nothing i can do?
Because in one class i have students with the same name and surname
Thanks
Reply With Quote
  #45  
Old 01-12-2017, 06:24 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,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

If they're identical, what does it matter that the dropdown only lists one? Surely the same choice would do for either? If not, how would you tell them apart when choosing from the dropdown so you know which one to pick? The alternative (provided they have different values in column B), would be to have both the column A & column B data appear for the dropdown selection.
__________________
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:44 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