ArchiveAgain
Messages postés7Date d'inscriptionlundi 7 novembre 2005StatutMembreDernière intervention 3 mars 2006
-
2 mars 2006 à 10:27
ArchiveAgain
Messages postés7Date d'inscriptionlundi 7 novembre 2005StatutMembreDernière intervention 3 mars 2006
-
3 mars 2006 à 14:44
Bonjour à tous.
je souhaiterais créer un lien hypertexte dans excel pour relier ma cellule "C" & i au répertoire créer précédemment "X:" & consultant & "" & chantier & "" & nom. Après avoir cherché pendant un moment et pas mal tourné en rond, ça serait cool si quelqu'un avait la solution. Ci-dessous lignes de code précédentes
Dim n As Integer
Dim i As Integer
Dim nom As String
nblot = InputBox("Combien de lots en charge ?")
n = 0
For n = 1 To nblot
nom = InputBox("Nom du lot n°" & n)
MkDir ("X:" & consultant & "" & chantier & "" & nom)
i = 2 * n + 1
ActiveSheet.Range("C" & i) = nom
cs_Willi
Messages postés2375Date d'inscriptionjeudi 12 juillet 2001StatutModérateurDernière intervention15 décembre 201822 2 mars 2006 à 17:34
ré
Tu y étais presque
Le premier paramètre de la méthode Add est la cellule qui doit recevoir le lien. Toi dans ton code tu pointés sur Cells(i,3). donc cela est normale que le lien ce fasse sur la feuille courante
ArchiveAgain
Messages postés7Date d'inscriptionlundi 7 novembre 2005StatutMembreDernière intervention 3 mars 2006 2 mars 2006 à 17:02
ça marche nickel par contre le lien s'inscrit sur la page d'origine du code alors que je souhaiterais qu'elle s'affiche sur la nouvelle créé pendant le code. Comment Faire ???
Je pense qu'il y a un ActiveSheet à inclure quelque part mais où ???
Private Sub CommandButton1_Click()
Dim chantier As String
Dim consultant As String
Dim nblot As Integer
chantier = InputBox("Nom du Chantier à créer ?")
If chantier = "" Then
MsgBox "Nom Incorrect"
Exit Sub
End If
consultant = InputBox("Nom du consultant ?") If consultant "Antoine" Or consultant "Kristell" Or consultant = "Jean-Philippe" Or consultant = "Daniel" Or consultant = "Thibaut" Then
Sheets.Add.Name = chantier
MkDir ("X:" & consultant & "" & chantier)
Else
MsgBox "Nom Incorrect"
Exit Sub
End If
Dim n As Integer
Dim i As Integer
Dim nom As String
nblot = InputBox("Combien de lots en charge ?")
n = 0
For n = 1 To nblot
nom = InputBox("Nom du lot n°" & n)
MkDir ("X:" & consultant & "" & chantier & "" & nom)
i = 2 * n + 1
Sheets(chantier).Cells(i, 3).Hyperlinks.Add Cells(i, 3), "X:" & consultant & "" & chantier & "" & nom, , , nom
Next n