
Private Sub CommandButton1_Click()
Worksheets("GEN. 2017").Select
With Worksheets("GEN. 2017")
.Rows("11:11").EntireRow.Hidden = False
.Rows("10:10").EntireRow.Hidden = True
End With
Application.ScreenUpdating = False
ActiveWindow.SelectedSheets.PrintOut copies:=1
Application.ScreenUpdating = True
With Worksheets("GEN. 2017")
.Rows("11:11").EntireRow.Hidden = True
.Rows("10:10").EntireRow.Hidden = False
End With
End Sub |
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim rng As Range
Dim cel As Range
Set rng = Worksheets("GEN. 2017").Range("A10:AE10")
For Each cel In rng
If cel.Value <> "" Then
cel.Value = "As"
End If
Next cel
End Sub |
Private Sub CommandButton1_Click()
Worksheets("GEN. 2017").Select
Dim Rng As Range
Dim Cel As Range
Dim Vettore()
Set Rng = Worksheets("GEN. 2017").Range("A10:AE10")
ReDim Vettore(1 To Rng.Cells.Count)
For Each Cel In Rng
Vettore(Cel.Column) = Cel.Value
If ((Cel.Value = "C") Or (Cel.Value = "Mal") Or (Cel.Value = "VS") Or (Cel.Value = "RF25")) Then
Cel.Value = "As"
End If
Next Cel
Application.ScreenUpdating = False
ActiveWindow.SelectedSheets.PrintOut copies:=1
Application.ScreenUpdating = True
For Each Cel In Rng
Cel.Value = Vettore(Cel.Column)
Next Cel
End Sub |
Private Sub CommandButton1_Click()
Worksheets("GEN. 2017").Select
Dim Rng As Range
Dim Cel As Range
Dim Vettore()
Dim Giorni
Dim Index
Giorni = 31
ReDim Vettore(1 To 5, 0 To Giorni)
Vettore(1, 0) = 10
Vettore(2, 0) = 13
Vettore(3, 0) = 16
Vettore(4, 0) = 19
Vettore(5, 0) = 22
For Index = 1 To 5
Set Rng = Worksheets("GEN. 2017").Range(Cells(Vettore(Index, 0), 1), Cells(Vettore(Index, 0), Giorni))
For Each Cel In Rng
Cel.Select
Vettore(Index, Cel.Column) = Cel.Value
If ((Cel.Value = "C") Or (Cel.Value = "Mal") Or (Cel.Value = "VS") Or (Left(Cel.Value, 2) = "RF")) Then
Cel.Value = "As"
End If
Next Cel
Next
Application.ScreenUpdating = False
ActiveWindow.SelectedSheets.PrintOut copies:=1
Application.ScreenUpdating = True
For Index = 1 To 5
Set Rng = Worksheets("GEN. 2017").Range(Cells(Vettore(Index, 0), 1), Cells(Vettore(Index, 0), Giorni))
For Each Cel In Rng
Cel.Value = Vettore(Index, Cel.Column)
Next Cel
Next
End Sub
|
