Paramétrer fonction avec nom de feuille

Arto -  
 Arto -
Bonjour,
Quelqu'un sait-il paramétrer une Function avec un nom de feuille?
il faut que j'exécute la fonction sur différentes feuilles, donc je foudrais que le nom "Feuil1", "Feuil2" soient des paramètres.
Merci d'avance
Configuration: Windows 2000 Internet Explorer 6.0
A voir également:

4 réponses

Maiden002 Messages postés 854 Statut Membre 134
 
je crois que c'est

Sheets("Feuil1").Copy (ou autre fonction que tu veux faire)
0
Arto
 
En fait j'ai une fonction qui gère les bordures dans une onglet.
J'aimerais à chaque fois que je rempli un onglet finir par:
Call bordure(onglet1), ou un autre onglet par exemple.

Seulement je n'arrive pas à faire en sorte que le nom de l'onglet soit paramètre.
Voici ma fonction:

Private Function bordure(nom_onglet)
Dim i As Integer
i = 5
While Sheets("nom_onglet").Cells(i, 1) <> ""
For j = 1 To 7
Sheets("nom_onglet").Cells(i, j).Borders(xlEdgeLeft).Weight = xlThin
Sheets("nom_onglet").Cells(i, j).Borders(xlEdgeRight).Weight = xlThin
Sheets("nom_onglet").Cells(i, j).Borders(xlEdgeBottom).Weight = xlThin
Next
i = i + 1
Wend
End Function
0
Maiden002 Messages postés 854 Statut Membre 134
 
     Dim i As Integer
    
             Range("A14").Select
                For i = 14 To 9999
                    If Range("A" & i).Interior.ColorIndex = xlNone Then
                            Exit For
                    End If
         Next i
    
            Range("A" & i).EntireRow.Insert
            Range("A" & i & ":G" & i).Select
 
            With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
            End With
            
            With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
            End With
            
            With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
            End With
            
            With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
            End With
            
            With Selection.Borders(xlInsideVertical)
            .LineStyle = xlContinuous
            .Weight = xlThin
            .ColorIndex = xlAutomatic
            End With


Je ne sais pas si ce code peut t'aider, mais il me permet de créer un ligne a partir de la ligne 14 de A14 a G14 avec des couleurs , bordure, etc
0
Arto
 
merci, ce code marche, mais le probleme de paramétrer une fonction avec le nom d'un onglet reste entier.
0