Hello,
I would like to make a macro which permit to searches a text chain within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Hello,
I would like to make a macro which permit to searches a text chain within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Hello,
I would like to make a macro which permit to searches a text chain within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Hello,
I would like to make a macro which permit to searches a text chain within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Hello,
I would like to make a macro which permit to searches a text chain within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Hello,
I would like to make a macro which permit to searches a text chain within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Hi,
You're on the french Excel Newsgroup.
However,for instance, with this program, you can search the word
"toto" thru
2 sheets ("Feuil1" and "Feuil2")
In this example, the program will return all the cells's adresses
that match
with the required word.
If you want a specific match, you've got to add the parameter
Lookat:=xlwhole in the instruction .Find(What:="toto") and turn in
.Find(What:="toto",lookat:=xlwhole)
For Each f In Sheets(Array("Feuil1", "Feuil2"))
With f.Cells
Set c = .Find(What:="toto")
If Not c Is Nothing Then
firstaddress = c.Address
MsgBox c.Address
Set c = .FindNext(c)
Do While c.Address <> firstaddress And Not c Is Nothing
MsgBox c.Address
Set c = .FindNext(c)
Loop
End If
End With
RegardsHello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the
range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Hi,
You're on the french Excel Newsgroup.
However,for instance, with this program, you can search the word
"toto" thru
2 sheets ("Feuil1" and "Feuil2")
In this example, the program will return all the cells's adresses
that match
with the required word.
If you want a specific match, you've got to add the parameter
Lookat:=xlwhole in the instruction .Find(What:="toto") and turn in
.Find(What:="toto",lookat:=xlwhole)
For Each f In Sheets(Array("Feuil1", "Feuil2"))
With f.Cells
Set c = .Find(What:="toto")
If Not c Is Nothing Then
firstaddress = c.Address
MsgBox c.Address
Set c = .FindNext(c)
Do While c.Address <> firstaddress And Not c Is Nothing
MsgBox c.Address
Set c = .FindNext(c)
Loop
End If
End With
Regards
Hello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the
range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Hi,
You're on the french Excel Newsgroup.
However,for instance, with this program, you can search the word
"toto" thru
2 sheets ("Feuil1" and "Feuil2")
In this example, the program will return all the cells's adresses
that match
with the required word.
If you want a specific match, you've got to add the parameter
Lookat:=xlwhole in the instruction .Find(What:="toto") and turn in
.Find(What:="toto",lookat:=xlwhole)
For Each f In Sheets(Array("Feuil1", "Feuil2"))
With f.Cells
Set c = .Find(What:="toto")
If Not c Is Nothing Then
firstaddress = c.Address
MsgBox c.Address
Set c = .FindNext(c)
Do While c.Address <> firstaddress And Not c Is Nothing
MsgBox c.Address
Set c = .FindNext(c)
Loop
End If
End With
RegardsHello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the
range is the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Écris donc en français, maudit colonisé.
Écris donc en français, maudit colonisé.
Écris donc en français, maudit colonisé.
Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message de news:Hello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" <matthieu_in_hk@hotmail.com> a $BqD(Brit dans le message de news:
e1EJDuPNFHA.508@TK2MSFTNGP12.phx.gbl...
Hello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message de news:Hello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Salut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la main!!
Merci,
Matthieu
"Daniel" wrote in message
news:ud#Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message de news:Hello,
I would like to make a macro which permit to searches a text chain
withinranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
thesame as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Salut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la main!!
Merci,
Matthieu
"Daniel" <dZZZcolardelle@free.fr> wrote in message
news:ud#EC6PNFHA.3788@tk2msftngp13.phx.gbl...
Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" <matthieu_in_hk@hotmail.com> a $BqD(Brit dans le message de news:
e1EJDuPNFHA.508@TK2MSFTNGP12.phx.gbl...
Hello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Salut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la main!!
Merci,
Matthieu
"Daniel" wrote in message
news:ud#Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message de news:Hello,
I would like to make a macro which permit to searches a text chain
withinranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
thesame as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
bonjour Mathew,
copie cette fonction dans un module,
Function MotCentre(ByVal Chaine$, _
Optional SeparateurX$ = " ", Optional SeparateurY$ = " ")
Dim posX, posY, nbcarT, nbcarX, MotIntérieurDélimité_X
nbcarT = Len(Chaine)
nbcarX = Len(SeparateurX)
posX = Application.Search(SeparateurX, Chaine)
posY = Application.Search(SeparateurY, Chaine, posX)
MotIntérieurDélimité_X = Right(Chaine, nbcarT - posX - nbcarX + 1)
On Error GoTo fin
MotCentre = Left(MotIntérieurDélimité_X, posY - posX - nbcarX)
Exit Function
fin:
MotCentre = MotIntérieurDélimité_X
End Function
et en la combinant avec la fonction SUPPRESPACE, tu auras le résultat
attendu.
=SUPPRESPACE(MotCentre(A1;" ";":"))
isabelleSalut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une
autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je
ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le
point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" wrote in message
news:ud#Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message de
news:
Hello,
I would like to make a macro which permit to searches a text chain
withinranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
thesame as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
bonjour Mathew,
copie cette fonction dans un module,
Function MotCentre(ByVal Chaine$, _
Optional SeparateurX$ = " ", Optional SeparateurY$ = " ")
Dim posX, posY, nbcarT, nbcarX, MotIntérieurDélimité_X
nbcarT = Len(Chaine)
nbcarX = Len(SeparateurX)
posX = Application.Search(SeparateurX, Chaine)
posY = Application.Search(SeparateurY, Chaine, posX)
MotIntérieurDélimité_X = Right(Chaine, nbcarT - posX - nbcarX + 1)
On Error GoTo fin
MotCentre = Left(MotIntérieurDélimité_X, posY - posX - nbcarX)
Exit Function
fin:
MotCentre = MotIntérieurDélimité_X
End Function
et en la combinant avec la fonction SUPPRESPACE, tu auras le résultat
attendu.
=SUPPRESPACE(MotCentre(A1;" ";":"))
isabelle
Salut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une
autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je
ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le
point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" <dZZZcolardelle@free.fr> wrote in message
news:ud#EC6PNFHA.3788@tk2msftngp13.phx.gbl...
Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" <matthieu_in_hk@hotmail.com> a $BqD(Brit dans le message de
news:
e1EJDuPNFHA.508@TK2MSFTNGP12.phx.gbl...
Hello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
bonjour Mathew,
copie cette fonction dans un module,
Function MotCentre(ByVal Chaine$, _
Optional SeparateurX$ = " ", Optional SeparateurY$ = " ")
Dim posX, posY, nbcarT, nbcarX, MotIntérieurDélimité_X
nbcarT = Len(Chaine)
nbcarX = Len(SeparateurX)
posX = Application.Search(SeparateurX, Chaine)
posY = Application.Search(SeparateurY, Chaine, posX)
MotIntérieurDélimité_X = Right(Chaine, nbcarT - posX - nbcarX + 1)
On Error GoTo fin
MotCentre = Left(MotIntérieurDélimité_X, posY - posX - nbcarX)
Exit Function
fin:
MotCentre = MotIntérieurDélimité_X
End Function
et en la combinant avec la fonction SUPPRESPACE, tu auras le résultat
attendu.
=SUPPRESPACE(MotCentre(A1;" ";":"))
isabelleSalut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une
autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je
ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le
point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" wrote in message
news:ud#Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message de
news:
Hello,
I would like to make a macro which permit to searches a text chain
withinranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
thesame as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Salut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" wrote in message
news:ud#Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message de
news:Hello,
I would like to make a macro which permit to searches a text chain
withinranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
thesame as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Salut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" <dZZZcolardelle@free.fr> wrote in message
news:ud#EC6PNFHA.3788@tk2msftngp13.phx.gbl...
Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" <matthieu_in_hk@hotmail.com> a $BqD(Brit dans le message de
news:
e1EJDuPNFHA.508@TK2MSFTNGP12.phx.gbl...
Hello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Salut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" wrote in message
news:ud#Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message de
news:Hello,
I would like to make a macro which permit to searches a text chain
withinranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range is
thesame as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Isabelle,
Merci pour ton aide.
Mais je ne vois pas comment on utilise la fct
=SUPPRESPACE(MotCentre(A1;" ";":"))
J'ecris ca ou ?
(Et dans le module ou j'ai copie le code, je dois faire une sub () ou bien
?)
Desole, je suis vraiment nul!!!
Matthieu
"isabelle" wrote in message
news:bonjour Mathew,
copie cette fonction dans un module,
Function MotCentre(ByVal Chaine$, _
Optional SeparateurX$ = " ", Optional SeparateurY$ = " ")
Dim posX, posY, nbcarT, nbcarX, MotIntérieurDélimité_X
nbcarT = Len(Chaine)
nbcarX = Len(SeparateurX)
posX = Application.Search(SeparateurX, Chaine)
posY = Application.Search(SeparateurY, Chaine, posX)
MotIntérieurDélimité_X = Right(Chaine, nbcarT - posX - nbcarX + 1)
On Error GoTo fin
MotCentre = Left(MotIntérieurDélimité_X, posY - posX - nbcarX)
Exit Function
fin:
MotCentre = MotIntérieurDélimité_X
End Function
et en la combinant avec la fonction SUPPRESPACE, tu auras le résultat
attendu.
=SUPPRESPACE(MotCentre(A1;" ";":"))
isabelleSalut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une
autrecase.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je
nevois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le
point,mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" wrote in message
news:ud#Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message
de
news:Hello,
I would like to make a macro which permit to searches a text chain
withinranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range
is
thesame as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Isabelle,
Merci pour ton aide.
Mais je ne vois pas comment on utilise la fct
=SUPPRESPACE(MotCentre(A1;" ";":"))
J'ecris ca ou ?
(Et dans le module ou j'ai copie le code, je dois faire une sub () ou bien
?)
Desole, je suis vraiment nul!!!
Matthieu
"isabelle" <hoHoho@hohoHo> wrote in message
news:uMiD3uZNFHA.204@TK2MSFTNGP15.phx.gbl...
bonjour Mathew,
copie cette fonction dans un module,
Function MotCentre(ByVal Chaine$, _
Optional SeparateurX$ = " ", Optional SeparateurY$ = " ")
Dim posX, posY, nbcarT, nbcarX, MotIntérieurDélimité_X
nbcarT = Len(Chaine)
nbcarX = Len(SeparateurX)
posX = Application.Search(SeparateurX, Chaine)
posY = Application.Search(SeparateurY, Chaine, posX)
MotIntérieurDélimité_X = Right(Chaine, nbcarT - posX - nbcarX + 1)
On Error GoTo fin
MotCentre = Left(MotIntérieurDélimité_X, posY - posX - nbcarX)
Exit Function
fin:
MotCentre = MotIntérieurDélimité_X
End Function
et en la combinant avec la fonction SUPPRESPACE, tu auras le résultat
attendu.
=SUPPRESPACE(MotCentre(A1;" ";":"))
isabelle
Salut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une
autre
case.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je
ne
vois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le
point,
mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" <dZZZcolardelle@free.fr> wrote in message
news:ud#EC6PNFHA.3788@tk2msftngp13.phx.gbl...
Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" <matthieu_in_hk@hotmail.com> a $BqD(Brit dans le message
de
news:
e1EJDuPNFHA.508@TK2MSFTNGP12.phx.gbl...
Hello,
I would like to make a macro which permit to searches a text chain
within
ranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range
is
the
same as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew
Isabelle,
Merci pour ton aide.
Mais je ne vois pas comment on utilise la fct
=SUPPRESPACE(MotCentre(A1;" ";":"))
J'ecris ca ou ?
(Et dans le module ou j'ai copie le code, je dois faire une sub () ou bien
?)
Desole, je suis vraiment nul!!!
Matthieu
"isabelle" wrote in message
news:bonjour Mathew,
copie cette fonction dans un module,
Function MotCentre(ByVal Chaine$, _
Optional SeparateurX$ = " ", Optional SeparateurY$ = " ")
Dim posX, posY, nbcarT, nbcarX, MotIntérieurDélimité_X
nbcarT = Len(Chaine)
nbcarX = Len(SeparateurX)
posX = Application.Search(SeparateurX, Chaine)
posY = Application.Search(SeparateurY, Chaine, posX)
MotIntérieurDélimité_X = Right(Chaine, nbcarT - posX - nbcarX + 1)
On Error GoTo fin
MotCentre = Left(MotIntérieurDélimité_X, posY - posX - nbcarX)
Exit Function
fin:
MotCentre = MotIntérieurDélimité_X
End Function
et en la combinant avec la fonction SUPPRESPACE, tu auras le résultat
attendu.
=SUPPRESPACE(MotCentre(A1;" ";":"))
isabelleSalut,
merci pour ta reponse hier sur le news group.
Comme tu a l'air de maitriser, j'aimerai te pose une autre question :
Dans mon tableau, j'ai des cases avec:
Hiroyuki.Ohama:(CI) CHANGE
Yukiko.Kojima:(CI) CHANGE
etc...
(Les espaces du debut y sont aussi)
Et je dois copier le nom des users (par ex :Yukiko.Kojima) dans une
autrecase.
Pour automatiser le truc sur tout le fichier je sais le faire, mais je
nevois
pas comment reussir a shope le nom des users qui sont tous differents.
On peut peut etre prendre le mot avant le point (.) le mot apres le
point,mais
je ne sais pas comment faire ca...
T'as pas une idee, ya au moins 15000 lignes je peux pas le faire a la
main!!
Merci,
Matthieu
"Daniel" wrote in message
news:ud#Bonjour.
Essaie :
Sub test()
Dim c As Range
Range("A1:B3").Select
For Each c In Selection
Var = InStr(1, c.Value, "this_word")
If Var > 0 Then
MsgBox c.Address
End If
Next c
End Sub
" Mathew" a $BqD(Brit dans le message
de
news:Hello,
I would like to make a macro which permit to searches a text chain
withinranges of an excel file.
For ex : If Range (XX) contains "this_word" then....
I can only searche when the text chain is exactly the same.
I would like to be able to do it even if only one word of the range
is
thesame as my text chain.
Does someone knows how to do this ?
Maybe it's a newbee question, sorry.
Thanks
Mathew