3

I would like to format a text. I mean something like this: I'd like to transform this:

"something'text between apostrophes'text"

into

"something 'text between apostrophes' text"

I want to add spaces from both sides, but keep te string in '' the same. I tried to do it like this:

  Arkusz1.Cells(1, 1).Replace What:="'*'" Replacement:=" '*' "

But its result is:

"something '*' text"

Arkusz1.Cells(1,1) contains the string I want to replace. Is it possible to do this? Thanks

0

1 Answer 1

2

You can try this regex:

('[^']+')

and replace by this:

" $1 "

Regex 101 Demo

Sign up to request clarification or add additional context in comments.

1 Comment

The OP is about VBA, not VB.NET.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.