Lien Hypertext

Fermé
gislain99 - 13 sept. 2013 à 20:50
gislain99 Messages postés 4 Date d'inscription mercredi 12 septembre 2012 Statut Membre Dernière intervention 25 novembre 2013 - 15 sept. 2013 à 18:06
Bonjour,

j'ai une feuille qui me sert à enregistrer des bon de livraison mon code me permet la numérotation l'archivage et l'impression automatique je souhaiterais lors de l'enregistrement du récapitulatif des information créer un lien HyperText pour pouvoir appeler ma feuille depuis ma base récapitulatif j'aimerais que mon lien soit le n° de BL qui se trouve en colonne A .

Ci joint mon code ou je voudrais intégrer mes lien HyperText


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim extension As String
Dim chemin As String, nomfichier As String
Dim style As Integer
If [C11] = "" Then
MsgBox "Veuiller saisir le nom de la société", vbExclamation, "Erreur de saisie"
Cancel = False
Exit Sub
End If
If [A20] = "" Then
MsgBox "Veuiller saisir la désignation", vbExclamation, "Erreur de saisie"
Cancel = False
Exit Sub
End If
ActiveSheet.Name = ("BL-") & Range("R9").Text 'renome la feuille

Worksheets("Dem.").Range("C11").Value = Feuil1.Range("C11").Value
Worksheets("Dem.").Range("N11").Value = Feuil1.Range("N11").Value
Worksheets("Dem.").Range("C13").Value = Feuil1.Range("C13").Value
Worksheets("Dem.").Range("R9").Value = Feuil1.Range("N°_BL").Value
Worksheets("Dem.").Range("N13").Value = Feuil1.Range("N13").Value

Worksheets("Pré.").Range("C11").Value = Feuil1.Range("C11").Value
Worksheets("Pré.").Range("N11").Value = Feuil1.Range("N11").Value
Worksheets("Pré.").Range("C13").Value = Feuil1.Range("C13").Value
Worksheets("Pré.").Range("R9").Value = Feuil1.Range("N°_BL").Value
Worksheets("Pré.").Range("N13").Value = Feuil1.Range("N13").Value

'Enregistrement info récapitulatif
With Worksheets("Récapitulatif-BL")
Dim DerLigne As Long
Dim Cell As Range
DerLigne = .Range("A65535").End(xlUp).Row + 1
.Cells(DerLigne, 1).Value = Feuil1.Range("R9").Value
.Cells(DerLigne, 3).Value = Feuil1.Range("C11").Value
.Cells(DerLigne, 6).Value = Feuil1.Range("N11").Value
.Cells(DerLigne, 9).Value = Feuil1.Range("C13").Value
.Cells(DerLigne, 12).Value = Feuil1.Range("N13").Value
'End With
Sheets(Array(ActiveSheet.Name)).PrintOut Copies:=1, Collate:=False 'Impression
'Sheets(Array("Dem.", "Pré.", ActiveSheet.Name)).PrintOut Copies:=1, Collate:=False 'Impression
'Enregistrement du BL
Application.ScreenUpdating = False
ThisWorkbook.ActiveSheet.Copy
extension = ".xls"
chemin = "C:\Wartsïla"
nomfichier = ActiveSheet.Name & extension
Range("N13").Value = Range("N13").Value 'garde uniquement le texte lors de la sauvegarde ne copie pas la formule

With ActiveWorkbook
.ActiveSheet.DrawingObjects(1).Delete
.SaveAs Filename:=chemin & "\" & nomfichier
.Close

'Vide toute les cellules Feuil1
End With
Range("n°_BL").Value = Range("n°_BL").Value + 1
[A20] = ""
[A21] = ""
[A22] = ""
[A23] = ""
[A24] = ""
[A25] = ""
[A26] = ""
[A27] = ""
[A28] = ""
[A29] = ""
[A30] = ""
[A31] = ""
[A32] = ""
[A33] = ""
[A34] = ""
[A35] = ""
[A36] = ""
[A37] = ""
[A38] = ""
[A39] = ""
[A40] = ""
[A41] = ""
[A42] = ""
[A43] = ""
[A44] = ""
[C11] = ""
[C13] = ""
[I20] = ""
[I21] = ""
[I22] = ""
[I23] = ""
[I24] = ""
[I25] = ""
[I26] = ""
[I27] = ""
[I28] = ""
[I29] = ""
[I30] = ""
[I31] = ""
[I32] = ""
[I33] = ""
[I34] = ""
[I35] = ""
[I36] = ""
[I37] = ""
[I38] = ""
[I39] = ""
[I40] = ""
[I41] = ""
[I42] = ""
[I43] = ""
[I44] = ""
[M20] = ""
[M21] = ""
[M22] = ""
[M23] = ""
[M24] = ""
[M25] = ""
[M26] = ""
[M27] = ""
[M28] = ""
[M29] = ""
[M30] = ""
[M31] = ""
[M32] = ""
[M33] = ""
[M34] = ""
[M35] = ""
[M36] = ""
[M37] = ""
[M38] = ""
[M39] = ""
[M40] = ""
[M41] = ""
[M42] = ""
[M43] = ""
[M44] = ""
[N11] = ""
[N20] = ""
[N21] = ""
[N22] = ""
[N23] = ""
[N24] = ""
[N25] = ""
[N26] = ""
[N27] = ""
[N28] = ""
[N29] = ""
[N30] = ""
[N31] = ""
[N32] = ""
[N33] = ""
[N34] = ""
[N35] = ""
[N36] = ""
[N37] = ""
[N38] = ""
[N39] = ""
[N40] = ""
[N41] = ""
[N42] = ""
[N43] = ""
[N44] = ""
[O20] = ""
[O21] = ""
[O22] = ""
[O23] = ""
[O24] = ""
[O25] = ""
[O26] = ""
[O27] = ""
[O28] = ""
[O29] = ""
[O30] = ""
[O31] = ""
[O32] = ""
[O33] = ""
[O34] = ""
[O35] = ""
[O36] = ""
[O37] = ""
[O38] = ""
[O39] = ""
[O40] = ""
[O41] = ""
[O42] = ""
[O43] = ""
[O44] = ""
[S20] = ""
[S21] = ""
[S22] = ""
[S23] = ""
[S24] = ""
[S25] = ""
[S26] = ""
[S27] = ""
[S28] = ""
[S29] = ""
[S30] = ""
[S31] = ""
[S32] = ""
[S33] = ""
[S34] = ""
[S35] = ""
[S36] = ""
[S37] = ""
[S38] = ""
[S39] = ""
[S40] = ""
[S41] = ""
[S42] = ""
[S43] = ""
[S44] = ""

'Vide toute les cellules Feuil2
Feuil2.Range("C11").MergeArea.ClearContents
Feuil2.Range("N11").MergeArea.ClearContents
Feuil2.Range("C13").MergeArea.ClearContents
Feuil2.Range("N13").MergeArea.ClearContents
Feuil2.Range("R9").MergeArea.ClearContents

'Vide toute les cellules Feuil3
Feuil3.Range("C11").MergeArea.ClearContents
Feuil3.Range("N11").MergeArea.ClearContents
Feuil3.Range("C13").MergeArea.ClearContents
Feuil3.Range("N13").MergeArea.ClearContents
Feuil3.Range("R9").MergeArea.ClearContents

End With
End Sub

1 réponse

gislain99 Messages postés 4 Date d'inscription mercredi 12 septembre 2012 Statut Membre Dernière intervention 25 novembre 2013
15 sept. 2013 à 18:06
Bonjour,

J'ais sortie la partie du code que je veut modifier

J'ais essayer mais je n'arrive pas a faire le code pour la partie lien HyperText

la cellule R9 est sous format spécial de type "0000" le soucie quand je récupère la valeur il me supprime les 0 devant le chiffre.

et j'ai l'erreur "sub ou fonction non définie pour CONCATENER

Quand je colle ma formule directement dans une cellule elle fonctionne je n'ais juste qu'un problème de 0 avant mon chiffre


Ci dessous mon code

With Worksheets("Récapitulatif-BL")
Dim DerLigne As Long
Dim Cell As Range
DerLigne = .Range("A65535").End(xlUp).Row + 1
.Cells(DerLigne, 1).Value = LIEN_HYPERTEXTE(CONCATENER("C:\Wartsïla\;R9;.xls")(Feuil1.Range("R9").Value))
.Cells(DerLigne, 3).Value = Feuil1.Range("C11").Value
.Cells(DerLigne, 6).Value = Feuil1.Range("N11").Value
.Cells(DerLigne, 9).Value = Feuil1.Range("C13").Value
.Cells(DerLigne, 12).Value = Feuil1.Range("N13").Value

Merci d'avance pour votre aide
0