Bonjour =E0 tous
J'ai une macro qui me permettais d'imprimer sur une plage les lignes
non vide, je veux l'utiliser pour un nouveau tableau mais voil=E0 c'est
un tableau qui comporte des formules dont il consid=E8re les lignes
=E9crite =E0 cause des formules !
SVP :auriez vous une solution ou que dois je modifi=E9
Merci =E0 vous et bonne soir=E9e.
***************************************************************************=
*********
Sub ImprimeTabMois()
impressionAutoris=E9e =3D True
Set champ =3D Range("$A$4:$J$160")
champ.Find("*", , , , xlByRows, xlPrevious).Offset(1, 0).Select
n =3D champ.Columns.Count
champ.Cells(65000, 1).End(xlUp).Offset(1, 0).Select
For i =3D 1 To champ.Rows.Count
If Application.CountA(champ.Cells(i, 1).Resize(1, n)) =3D 0 Then
Union(Selection, champ.Cells(i, 1)).Select
End If
Next i
Selection.EntireRow.Hidden =3D True
ActiveSheet.PageSetup.PrintArea =3D champ.Address
ActiveWindow.SelectedSheets.PrintOut Copies:=3D1, Collate:=3DTrue
Cells.EntireRow.Hidden =3D False
Range("A6").Select
impressionAutoris=E9e =3D False
End Sub
Tu dois renseigner la variable "Sh" selon ton application. La procédure utilise une colonne supplémentaire "K" que tu peux remplacer par celle de ton choix au besoin... Après test, tu remplaces : Sh.PrintPreview Par Sh.PrintOut
'-------------------------------------------------------- Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse Sh.PrintPreview 'Sh.PrintOut .AutoFilter .ClearContents End With End With End Sub '--------------------------------------------------------
MichD ------------------------------------------ "Tibert" a écrit dans le message de groupe de discussion :
Bonjour à tous J'ai une macro qui me permettais d'imprimer sur une plage les lignes non vide, je veux l'utiliser pour un nouveau tableau mais voilà c'est un tableau qui comporte des formules dont il considère les lignes écrite à cause des formules ! SVP :auriez vous une solution ou que dois je modifié
Merci à vous et bonne soirée.
************************************************************************************ Sub ImprimeTabMois() impressionAutorisée = True Set champ = Range("$A$4:$J$160") champ.Find("*", , , , xlByRows, xlPrevious).Offset(1, 0).Select n = champ.Columns.Count champ.Cells(65000, 1).End(xlUp).Offset(1, 0).Select For i = 1 To champ.Rows.Count If Application.CountA(champ.Cells(i, 1).Resize(1, n)) = 0 Then Union(Selection, champ.Cells(i, 1)).Select End If Next i Selection.EntireRow.Hidden = True ActiveSheet.PageSetup.PrintArea = champ.Address ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Cells.EntireRow.Hidden = False
Range("A6").Select impressionAutorisée = False End Sub
Bonjour,
Essaie cette macro :
Tu dois renseigner la variable "Sh" selon ton application.
La procédure utilise une colonne supplémentaire "K" que tu peux remplacer
par celle de ton choix au besoin...
Après test, tu remplaces : Sh.PrintPreview Par Sh.PrintOut
'--------------------------------------------------------
Sub ImprimeTabMois1()
Dim Sh As Worksheet, DerLig As Long
Set Sh = Worksheets("Feuil1")
With Sh
With .Range("$A$4:$J$160")
DerLig = .Find(What:="*", _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _
"=Nbval(" & .Item(1).Rows(1).Resize _
(, .Columns.Count).Address(0, 0) & ")"
End With
With .Range("k3:K" & DerLig)
.AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse
Sh.PrintPreview 'Sh.PrintOut
.AutoFilter
.ClearContents
End With
End With
End Sub
'--------------------------------------------------------
MichD
------------------------------------------
"Tibert" a écrit dans le message de groupe de discussion :
1f37a902-c668-43e8-a350-fd2d69ee2244@gi10g2000vbb.googlegroups.com...
Bonjour à tous
J'ai une macro qui me permettais d'imprimer sur une plage les lignes
non vide, je veux l'utiliser pour un nouveau tableau mais voilà c'est
un tableau qui comporte des formules dont il considère les lignes
écrite à cause des formules !
SVP :auriez vous une solution ou que dois je modifié
Merci à vous et bonne soirée.
************************************************************************************
Sub ImprimeTabMois()
impressionAutorisée = True
Set champ = Range("$A$4:$J$160")
champ.Find("*", , , , xlByRows, xlPrevious).Offset(1, 0).Select
n = champ.Columns.Count
champ.Cells(65000, 1).End(xlUp).Offset(1, 0).Select
For i = 1 To champ.Rows.Count
If Application.CountA(champ.Cells(i, 1).Resize(1, n)) = 0 Then
Union(Selection, champ.Cells(i, 1)).Select
End If
Next i
Selection.EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = champ.Address
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Cells.EntireRow.Hidden = False
Range("A6").Select
impressionAutorisée = False
End Sub
Tu dois renseigner la variable "Sh" selon ton application. La procédure utilise une colonne supplémentaire "K" que tu peux remplacer par celle de ton choix au besoin... Après test, tu remplaces : Sh.PrintPreview Par Sh.PrintOut
'-------------------------------------------------------- Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse Sh.PrintPreview 'Sh.PrintOut .AutoFilter .ClearContents End With End With End Sub '--------------------------------------------------------
MichD ------------------------------------------ "Tibert" a écrit dans le message de groupe de discussion :
Bonjour à tous J'ai une macro qui me permettais d'imprimer sur une plage les lignes non vide, je veux l'utiliser pour un nouveau tableau mais voilà c'est un tableau qui comporte des formules dont il considère les lignes écrite à cause des formules ! SVP :auriez vous une solution ou que dois je modifié
Merci à vous et bonne soirée.
************************************************************************************ Sub ImprimeTabMois() impressionAutorisée = True Set champ = Range("$A$4:$J$160") champ.Find("*", , , , xlByRows, xlPrevious).Offset(1, 0).Select n = champ.Columns.Count champ.Cells(65000, 1).End(xlUp).Offset(1, 0).Select For i = 1 To champ.Rows.Count If Application.CountA(champ.Cells(i, 1).Resize(1, n)) = 0 Then Union(Selection, champ.Cells(i, 1)).Select End If Next i Selection.EntireRow.Hidden = True ActiveSheet.PageSetup.PrintArea = champ.Address ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Cells.EntireRow.Hidden = False
Range("A6").Select impressionAutorisée = False End Sub
MichD
Une petite modification ...
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------
Une petite modification ...
'------------------------------------------
Sub ImprimeTabMois1()
Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh
With .Range("$A$4:$J$160")
Adr = .Parent.Name & "!" & .Address
DerLig = .Find(What:="*", _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _
"=Nbval(" & .Item(1).Rows(1).Resize _
(, .Columns.Count).Address(0, 0) & ")"
End With
With .Range("k3:K" & DerLig)
.AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse
Sh.PageSetup.PrintArea = Adr
Sh.PrintPreview 'Sh.PrintOut
Sh.PageSetup.PrintArea = ""
.AutoFilter
.ClearContents
End With
End With
End Sub
'------------------------------------------
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------
Tibert
Bonsoir MichD Merci pour ta réponse ! mais serait il possible d'avoir le code sans le nom de feuille car je veux utiliser cette macro sur feuille active et comme je fais un bouton pour utiliser cette macro sa me permette de l'utiliser sur plusieurs feuille. Merci !
On 31 jan, 21:07, "MichD" wrote:
Une petite modification ...
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Ro w
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------
Bonsoir MichD
Merci pour ta réponse ! mais serait il possible d'avoir le code sans
le nom de feuille
car je veux utiliser cette macro sur feuille active et comme je fais
un bouton pour utiliser
cette macro sa me permette de l'utiliser sur plusieurs feuille.
Merci !
On 31 jan, 21:07, "MichD" <michde...@hotmail.com> wrote:
Une petite modification ...
'------------------------------------------
Sub ImprimeTabMois1()
Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh
With .Range("$A$4:$J$160")
Adr = .Parent.Name & "!" & .Address
DerLig = .Find(What:="*", _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Ro w
Sh.Range("K4:K" & DerLig).FormulaLocal = _
"=Nbval(" & .Item(1).Rows(1).Resize _
(, .Columns.Count).Address(0, 0) & ")"
End With
With .Range("k3:K" & DerLig)
.AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:=False
Sh.PageSetup.PrintArea = Adr
Sh.PrintPreview 'Sh.PrintOut
Sh.PageSetup.PrintArea = ""
.AutoFilter
.ClearContents
End With
End With
End Sub
'------------------------------------------
Bonsoir MichD Merci pour ta réponse ! mais serait il possible d'avoir le code sans le nom de feuille car je veux utiliser cette macro sur feuille active et comme je fais un bouton pour utiliser cette macro sa me permette de l'utiliser sur plusieurs feuille. Merci !
On 31 jan, 21:07, "MichD" wrote:
Une petite modification ...
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Ro w
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------
Tibert
Bonsoir MichD
Pour info et en complément sur mon tableau la colonne A n'a pas de formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" wrote:
Une petite modification ...
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Ro w
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------
Bonsoir MichD
Pour info et en complément sur mon tableau la colonne A n'a pas de
formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" <michde...@hotmail.com> wrote:
Une petite modification ...
'------------------------------------------
Sub ImprimeTabMois1()
Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh
With .Range("$A$4:$J$160")
Adr = .Parent.Name & "!" & .Address
DerLig = .Find(What:="*", _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Ro w
Sh.Range("K4:K" & DerLig).FormulaLocal = _
"=Nbval(" & .Item(1).Rows(1).Resize _
(, .Columns.Count).Address(0, 0) & ")"
End With
With .Range("k3:K" & DerLig)
.AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:=False
Sh.PageSetup.PrintArea = Adr
Sh.PrintPreview 'Sh.PrintOut
Sh.PageSetup.PrintArea = ""
.AutoFilter
.ClearContents
End With
End With
End Sub
'------------------------------------------
Pour info et en complément sur mon tableau la colonne A n'a pas de formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" wrote:
Une petite modification ...
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Ro w
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------
MichD
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = ActiveSheet
With Sh With .Range("$B$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
Sh.Range("A4:A" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("A3:A" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------ "Tibert" a écrit dans le message de groupe de discussion :
Bonsoir MichD
Pour info et en complément sur mon tableau la colonne A n'a pas de formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" wrote:
Une petite modification ...
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------
'------------------------------------------
Sub ImprimeTabMois1()
Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = ActiveSheet
With Sh
With .Range("$B$4:$J$160")
Adr = .Parent.Name & "!" & .Address
DerLig = .Find(What:="*", _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
Sh.Range("A4:A" & DerLig).FormulaLocal = _
"=Nbval(" & .Item(1).Rows(1).Resize _
(, .Columns.Count).Address(0, 0) & ")"
End With
With .Range("A3:A" & DerLig)
.AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse
Sh.PageSetup.PrintArea = Adr
Sh.PrintPreview 'Sh.PrintOut
Sh.PageSetup.PrintArea = ""
.AutoFilter
.ClearContents
End With
End With
End Sub
'------------------------------------------
MichD
------------------------------------------
"Tibert" a écrit dans le message de groupe de discussion :
c97a1144-11ae-49fe-92d1-2081cf4ef460@hb4g2000vbb.googlegroups.com...
Bonsoir MichD
Pour info et en complément sur mon tableau la colonne A n'a pas de
formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" <michde...@hotmail.com> wrote:
Une petite modification ...
'------------------------------------------
Sub ImprimeTabMois1()
Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh
With .Range("$A$4:$J$160")
Adr = .Parent.Name & "!" & .Address
DerLig = .Find(What:="*", _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _
"=Nbval(" & .Item(1).Rows(1).Resize _
(, .Columns.Count).Address(0, 0) & ")"
End With
With .Range("k3:K" & DerLig)
.AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse
Sh.PageSetup.PrintArea = Adr
Sh.PrintPreview 'Sh.PrintOut
Sh.PageSetup.PrintArea = ""
.AutoFilter
.ClearContents
End With
End With
End Sub
'------------------------------------------
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = ActiveSheet
With Sh With .Range("$B$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
Sh.Range("A4:A" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("A3:A" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------ "Tibert" a écrit dans le message de groupe de discussion :
Bonsoir MichD
Pour info et en complément sur mon tableau la colonne A n'a pas de formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" wrote:
Une petite modification ...
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = Worksheets("Feuil1")
With Sh With .Range("$A$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row
Sh.Range("K4:K" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("k3:K" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDropDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------
Tibert
Bonjour MichD
et merci pour ton aide
On 31 jan, 22:49, "MichD" wrote:
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = ActiveSheet
With Sh With .Range("$B$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Ro w
Sh.Range("A4:A" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("A3:A" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------ "Tibert" a écrit dans le message de groupe de discussion :
Bonsoir MichD
Pour info et en complément sur mon tableau la colonne A n'a pas de formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" wrote:
> Une petite modification ...
> '------------------------------------------ > Sub ImprimeTabMois1() > Dim Sh As Worksheet, DerLig As Long, Adr As String
> Set Sh = Worksheets("Feuil1")
> With Sh > With .Range("$A$4:$J$160") > Adr = .Parent.Name & "!" & .Address > DerLig = .Find(What:="*", _ > LookIn:=xlValues, _ > SearchOrder:=xlByRows, _ > SearchDirection:=xlPrevious). Row
> Sh.Range("K4:K" & DerLig).FormulaLocal = _ > "=Nbval(" & .Item(1).Rows(1).Resize _ > (, .Columns.Count).Address(0, 0) & ")" > End With > With .Range("k3:K" & DerLig) > .AutoFilter field:=1, Criteria1:="<>" & 0, visibleD ropDown:úlse > Sh.PageSetup.PrintArea = Adr > Sh.PrintPreview 'Sh.PrintOut > Sh.PageSetup.PrintArea = "" > .AutoFilter > .ClearContents > End With > End With > End Sub > '------------------------------------------
On 31 jan, 22:49, "MichD" <michde...@hotmail.com> wrote:
'------------------------------------------
Sub ImprimeTabMois1()
Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = ActiveSheet
With Sh
With .Range("$B$4:$J$160")
Adr = .Parent.Name & "!" & .Address
DerLig = .Find(What:="*", _
LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Ro w
Sh.Range("A4:A" & DerLig).FormulaLocal = _
"=Nbval(" & .Item(1).Rows(1).Resize _
(, .Columns.Count).Address(0, 0) & ")"
End With
With .Range("A3:A" & DerLig)
.AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:=False
Sh.PageSetup.PrintArea = Adr
Sh.PrintPreview 'Sh.PrintOut
Sh.PageSetup.PrintArea = ""
.AutoFilter
.ClearContents
End With
End With
End Sub
'------------------------------------------
MichD
------------------------------------------
"Tibert" a écrit dans le message de groupe de discussion :
c97a1144-11ae-49fe-92d1-2081cf4ef...@hb4g2000vbb.googlegroups.com...
Bonsoir MichD
Pour info et en complément sur mon tableau la colonne A n'a pas de
formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" <michde...@hotmail.com> wrote:
> Une petite modification ...
> '------------------------------------------
> Sub ImprimeTabMois1()
> Dim Sh As Worksheet, DerLig As Long, Adr As String
> Set Sh = Worksheets("Feuil1")
> With Sh
> With .Range("$A$4:$J$160")
> Adr = .Parent.Name & "!" & .Address
> DerLig = .Find(What:="*", _
> LookIn:=xlValues, _
> SearchOrder:=xlByRows, _
> SearchDirection:=xlPrevious). Row
> Sh.Range("K4:K" & DerLig).FormulaLocal = _
> "=Nbval(" & .Item(1).Rows(1).Resize _
> (, .Columns.Count).Address(0, 0) & ")"
> End With
> With .Range("k3:K" & DerLig)
> .AutoFilter field:=1, Criteria1:="<>" & 0, visibleD ropDown:=False
> Sh.PageSetup.PrintArea = Adr
> Sh.PrintPreview 'Sh.PrintOut
> Sh.PageSetup.PrintArea = ""
> .AutoFilter
> .ClearContents
> End With
> End With
> End Sub
> '------------------------------------------
'------------------------------------------ Sub ImprimeTabMois1() Dim Sh As Worksheet, DerLig As Long, Adr As String
Set Sh = ActiveSheet
With Sh With .Range("$B$4:$J$160") Adr = .Parent.Name & "!" & .Address DerLig = .Find(What:="*", _ LookIn:=xlValues, _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Ro w
Sh.Range("A4:A" & DerLig).FormulaLocal = _ "=Nbval(" & .Item(1).Rows(1).Resize _ (, .Columns.Count).Address(0, 0) & ")" End With With .Range("A3:A" & DerLig) .AutoFilter field:=1, Criteria1:="<>" & 0, visibleDro pDown:úlse Sh.PageSetup.PrintArea = Adr Sh.PrintPreview 'Sh.PrintOut Sh.PageSetup.PrintArea = "" .AutoFilter .ClearContents End With End With End Sub '------------------------------------------
MichD ------------------------------------------ "Tibert" a écrit dans le message de groupe de discussion :
Bonsoir MichD
Pour info et en complément sur mon tableau la colonne A n'a pas de formule es ce que elle peut être utiliser pour faire le code !
Meci
On 31 jan, 21:07, "MichD" wrote:
> Une petite modification ...
> '------------------------------------------ > Sub ImprimeTabMois1() > Dim Sh As Worksheet, DerLig As Long, Adr As String
> Set Sh = Worksheets("Feuil1")
> With Sh > With .Range("$A$4:$J$160") > Adr = .Parent.Name & "!" & .Address > DerLig = .Find(What:="*", _ > LookIn:=xlValues, _ > SearchOrder:=xlByRows, _ > SearchDirection:=xlPrevious). Row
> Sh.Range("K4:K" & DerLig).FormulaLocal = _ > "=Nbval(" & .Item(1).Rows(1).Resize _ > (, .Columns.Count).Address(0, 0) & ")" > End With > With .Range("k3:K" & DerLig) > .AutoFilter field:=1, Criteria1:="<>" & 0, visibleD ropDown:úlse > Sh.PageSetup.PrintArea = Adr > Sh.PrintPreview 'Sh.PrintOut > Sh.PageSetup.PrintArea = "" > .AutoFilter > .ClearContents > End With > End With > End Sub > '------------------------------------------