How to extend a sting colour forward and backword until space is found ?

jaimond

Board Regular
Joined
Jun 23, 2017
Messages
56
some or a part of a substing has a color.
How to extend the color forward and backword until space is found to make it fully colored with the present colour ?
There are multiple rows, columns and sheets.
 
.. I can see no logic ...
Me either, but we are not the one posing the question and have no idea of the purpose or use of the result. So I have just tried to deal with the circumstances as given by the OP. So far at least, post #17 would indicate success.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
One.Two becomes One.Two

whereas

One.Two becomes One.Two [after "." it should check the space. If space is not found then this example appears problem]

I think here I need help then. Thanks Rick.
 
Upvote 0
One.Two becomes One.Two

whereas

One.Two becomes One.Two [after "." it should check the space. If space is not found then this example appears problem]

I think here I need help then. Thanks Rick.
Before a program can be written, we need clearly defined requirements. So far, you seem to be defining your requirements in pieces which causes any program that has been written to have to be revised, sometimes drastically so, in order to handle the "new" requirements. It would be real helpful if you could spell out in clear detail what should be colored and when. I am going to show you several text fragments with one or more characters colored within them... please show us how they should be colored. I noticed you were a little sloppy about doing this earlier, so I am going to ask you to check and then double-check the answers you give us (pay particular attention to whether the non-alphanumeric characters adjacent to the text with colored letters should be colored or not).

1) check and then double-check the answers

2) check and then double-check the answers

3) handle the "new" requirements

4) within them... please

5) I bought a new car (Toyota) today

6) pick a size (small/medium/large) for your order

7) pick a size (small/medium/large) for your order

8) pick a size (small/medium/large) for your order

9) an apostrophe 'quoted' word

I think that covers the bulk of the types of situations that need to be quoted around. Note that we will make "educated guess" about alternates above (for example, what you tell us to do with a dash in the middle of text is what we will do if that dash were a slash instead. Similarly, what you tell us about a word in parentheses is what we will do if the word is surrounded by square or curly brackets instead.
 
Last edited:
Upvote 0
One.Two becomes One.Two
I am also unclear whether this statement is telling us what the answer should be, or what the previous code actually did when you tested it on your data?
 
Upvote 0
I am also unclear whether this statement is telling us what the answer should be, or what the previous code actually did when you tested it on your data?
@Peter,

I read the OP's comments within the square brackets of Message #22 as saying the coloring was correct if a space followed the dot, but not correct otherwise which I took to mean the first example with all the text colored was what he was after when there was no space after the dot.



@jaimond,

Make sure you look at Message #23 and answer all the questions I asked there.
 
Last edited:
Upvote 0
Help:

How to extend a sting color forward and backward until space is found?​


The VBA code can not turn .
Thankyou.Again = .Thankyou.Again
sss Thankyou.Again = .Thankyou.Again
to
Thankyou.Again = .Thankyou.Again
sss Thankyou.Again = .Thankyou.Again
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top