Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2021, 05:41 AM
VBAFiddler VBAFiddler is offline extending a selection Windows 10 extending a selection Office 2016
Novice
extending a selection
 
Join Date: Feb 2021
Posts: 14
VBAFiddler is on a distinguished road
Post extending a selection

Hi,
Not quite sure how to achieve this. I'm searching for a reference or references, they all begin Ref: followed by two digits. This is followed by various characters, and I need to extend the selection to include these.
I assume I need to use "With Selection", and what I want to do is to extend the selection until there is a punctuation mark, or a space. I started by just adding 7 to the .end of a range, but that excluded some and sometimes included bits I didn't want.
I've not included any of my code as I'm not entirely sure where to start with this,
Thanks,
David.
Reply With Quote
  #2  
Old 03-05-2021, 10:31 PM
macropod's Avatar
macropod macropod is offline extending a selection Windows 10 extending a selection Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Assuming the 'various characters' don't include spaces, etc., with a wildcard Find:
<Ref:[0-9]{2}*>
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-06-2021, 03:17 PM
VBAFiddler VBAFiddler is offline extending a selection Windows 10 extending a selection Office 2016
Novice
extending a selection
 
Join Date: Feb 2021
Posts: 14
VBAFiddler is on a distinguished road
Default

Far more effective! Probably breaking a rule here, but how would I paste these references into a new blank document. Not worried about saving,
Many thanks,

David.
Reply With Quote
  #4  
Old 03-07-2021, 12:32 AM
macropod's Avatar
macropod macropod is offline extending a selection Windows 10 extending a selection Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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/128621-post2.html
https://www.msofficeforums.com/118412-post2.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-07-2021, 12:38 PM
VBAFiddler VBAFiddler is offline extending a selection Windows 10 extending a selection Office 2016
Novice
extending a selection
 
Join Date: Feb 2021
Posts: 14
VBAFiddler is on a distinguished road
Default

Perfect!
Thanks,
DAvid.
Reply With Quote
Reply

Tags
extend, selection, vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
typing "scr" and problem with "extending selection" danielmatt Word 16 07-21-2019 12:31 PM
Extending or shortening an existing line ironman1159 Drawing and Graphics 0 07-01-2019 03:06 PM
extending a selection Resource not getting enough hours allocated to them, therefore extending duration joday48 Project 1 08-01-2014 08:54 AM
extending a selection Extending Table or Textbox to Next Page Jazz43 Word 3 10-17-2012 01:43 AM
extending an arrow? danjohnson10 PowerPoint 1 04-23-2011 04:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:45 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