Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2021, 09:17 AM
lalywizz lalywizz is offline Add Space between number and letter Windows 10 Add Space between number and letter Office 2016
Novice
Add Space between number and letter
 
Join Date: Sep 2021
Posts: 7
lalywizz is on a distinguished road
Default Add Space between number and letter


Hi There,

In the text I have to corrrect, I use to have no space between number and letter. For example, I have "48hours", and I need to correct it for "48 hours". All the text is like that.

Is there a quick Find and replace, or a VBA code which could help me to automatically add a space between a number and a letter?


Thanks!
Reply With Quote
  #2  
Old 09-17-2021, 01:21 PM
rollis13's Avatar
rollis13 rollis13 is offline Add Space between number and letter Windows 10 Add Space between number and letter Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 140
rollis13 will become famous soon enough
Default

As per your example:

In Find type: ([0-9]@)(h)
in Replace type: \1 \2
Note that there is a single space just after the 1.
Click More>> and check Use wildcards
Click Replace All
It means:
Find one or more number ([0-9]@) followed by a lowercase h (h)
Replace with: same first element found (the numbers) \1 add a space " " then same second element found (the h) \2

***Never do testing on original files*** unless you can do an Undo .
Reply With Quote
  #3  
Old 09-17-2021, 02:11 PM
lalywizz lalywizz is offline Add Space between number and letter Windows 10 Add Space between number and letter Office 2016
Novice
Add Space between number and letter
 
Join Date: Sep 2021
Posts: 7
lalywizz is on a distinguished road
Default

Quote:
Originally Posted by rollis13 View Post
As per your example:

In Find type: ([0-9]@)(h)
in Replace type: \1 \2
Note that there is a single space just after the 1.
Click More>> and check Use wildcards
Click Replace All
It means:
Find one or more number ([0-9]@) followed by a lowercase h (h)
Replace with: same first element found (the numbers) \1 add a space " " then same second element found (the h) \2

***Never do testing on original files*** unless you can do an Undo .

Unfortunately, I did exactly what you explained, and I get 0 result found...

I don't know if it's changing something, but I don't need to search for a lowercase just after a number. So even though it's written:
48hours = I need to change it for 48 hours
250lbs = 250 lbs
100FT = 100 FT
150F = 150 F
Reply With Quote
  #4  
Old 09-17-2021, 02:45 PM
rollis13's Avatar
rollis13 rollis13 is offline Add Space between number and letter Windows 10 Add Space between number and letter Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 140
rollis13 will become famous soon enough
Default

Change your Find like this:

([0-9]@)([a-z,A-Z])
Reply With Quote
  #5  
Old 09-18-2021, 06:03 AM
lalywizz lalywizz is offline Add Space between number and letter Windows 10 Add Space between number and letter Office 2016
Novice
Add Space between number and letter
 
Join Date: Sep 2021
Posts: 7
lalywizz is on a distinguished road
Default

Yes! It's working! It's exactly what I was looking for!!

Thanks rollis13 !!!!
Reply With Quote
  #6  
Old 09-18-2021, 06:13 AM
rollis13's Avatar
rollis13 rollis13 is offline Add Space between number and letter Windows 10 Add Space between number and letter Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 140
rollis13 will become famous soon enough
Default

Glad having been of some help .
Reply With Quote
Reply

Tags
space between, vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Space between number and letter How to send a letter with customized name/ID for a large number of people Jacob86 Word 3 04-28-2021 09:09 AM
Add Space between number and letter white letter instead off space merletcollege Word 3 09-27-2018 01:19 AM
Add Space between number and letter Formula for calculating total when number and letter in one cell Oleg Excel 5 02-22-2017 03:05 AM
Add Space between number and letter How to add a letter infront of the page number Word 2016 magician35 Word 2 02-12-2017 07:28 AM
Add Space between number and letter is it possibe to capitalize every letter after a "colon space" angeltread Word VBA 4 01-17-2011 03:50 PM

Other Forums: Access Forums

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