VBA : adding and removing text within cells

  • Thread starter Thread starter Annie
  • Start date Start date
A

Annie

Hi, I have a field named "Postal" at the top of column F that always include
a number with 5 digits then a city name then a region name, such as "11090
CARCASSONNE Linguadoca-Rossiglione". I need to create a program to have this
field changed as following : "F-11090", then copying "CARCASSONNE" into the
City field which is empty (column G). The city name is always starting just
one space character after the postcode, same thing for the region name, it
always starts one space character after the city name. The region has to be
removed completely.
Also, I have a field named Phone (column E), it is always starting with
"+33", and I need to remove the "+33" automatically while keeping the
following numbers in the fields.

Maybe someone could help me ?
Thanks very much
Annie
 
Do you *need* to use VBA? You can get the same results without it.
For column F, if the entries are always in the format similar to "11090
City name city name etc", you can insert a "helper" column and write a
formula that references column F, like this:
="F-"&MID(F1,1,5)

For column E, can you do a search and replace? Search for "+33" and
leave the "replace with" box blank.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top