Thema Datum  Von Nutzer Rating
Antwort
Rot Macro for adding and verifiyng country code phone number(prefix)
13.08.2015 10:27:44 Brever
NotSolved
14.08.2015 12:23:06 Gast39681
NotSolved

Ansicht des Beitrags:
Von:
Brever
Datum:
13.08.2015 10:27:44
Views:
1046
Rating: Antwort:
  Ja
Thema:
Macro for adding and verifiyng country code phone number(prefix)

Hello everyone,

I am new on the forum and new to the vba coding, to be honest, a couple of classes in college and that`s it  

The thing is that I receive daily files with the wrong country code phone(prefix) or missing and I need the macro to add it by default because I have hundreds of entries.

I have my phone no`s in column K and I need the macro to first verify the country phone code based on the country in column J and if the number starts with the correct country phone code, move to the next row, if it doesn`t, it should add it. I need to mention that I will always have the phone number and the specific country on the same row.

I have here a code that only adds a country predefined value to the cell but having no reference to the country, it doesn't look for the country information to add it depending on the specific country.

Many thanks in advance, I really appreciate any suggestion

[ForEach r In Range("K2:K")IfNot(Left(r.Value,2)="44")Then
r.Value ="44"& r.Value
EndIf
Next r]


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
Rot Macro for adding and verifiyng country code phone number(prefix)
13.08.2015 10:27:44 Brever
NotSolved
14.08.2015 12:23:06 Gast39681
NotSolved