#1
|
|||
|
|||
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! |
#2
|
||||
|
||||
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 . |
#3
|
|||
|
|||
Quote:
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 |
#4
|
||||
|
||||
Change your Find like this:
([0-9]@)([a-z,A-Z]) |
#5
|
|||
|
|||
Yes! It's working! It's exactly what I was looking for!!
Thanks rollis13 !!!! |
#6
|
||||
|
||||
Glad having been of some help .
|
Tags |
space between, vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to send a letter with customized name/ID for a large number of people | Jacob86 | Word | 3 | 04-28-2021 09:09 AM |
white letter instead off space | merletcollege | Word | 3 | 09-27-2018 01:19 AM |
Formula for calculating total when number and letter in one cell | Oleg | Excel | 5 | 02-22-2017 03:05 AM |
How to add a letter infront of the page number Word 2016 | magician35 | Word | 2 | 02-12-2017 07:28 AM |
is it possibe to capitalize every letter after a "colon space" | angeltread | Word VBA | 4 | 01-17-2011 03:50 PM |