
Dim CL As Object, a
For Each CL In Range("Prescr")
For a = 9 To 14
If Cells(a, 1).Value = 1 And CL <> "" Then
CL.Offset(1, 0) = "'===="
End If
Next a
Next CL
End Sub |
Option Explicit
Sub scorri_e_riempi()
Dim r As Range, v As Variant
Set r = Range("A9:A16")
v = Application.Transpose(r)
r.Resize(r.Rows.Count, 10).SpecialCells(xlCellTypeBlanks) = "'==="
r = Application.Transpose(v)
End Sub |
Option Explicit
Sub scorri_e_riempi()
Dim r As Range, v As Variant
Set r = Range("A9:A16")
v = Application.Transpose(r)
r.Resize(r.Rows.Count, 10).SpecialCells(xlCellTypeBlanks) = "'==="
r = Application.Transpose(v)
End Sub |
Option Explicit
Sub scorri_e_riempi()
Dim r As Range, x As Long, y As Long
For x = 9 To 15
If Cells(x, 1) = "01" Then
For y = 2 To 10
If Cells(x, y) = "" Then
Set r = Range("B" & x & ":J" & x + 1)
r = "'==="
Exit For
End If
Next y
End If
Next x
Set r = Nothing
End Sub |
Option Explicit
Sub scorri_e_riempi()
Dim r As Range, x As Long, y As Long, Qt1 As Long, Qt2 As Long
Qt1 = 1
For x = 9 To 16
Qt2 = Application.WorksheetFunction.CountIf(Range("B" & x & ":J" & x), "")
If Qt2 > 0 Then
For y = 2 To 10
If Cells(x, y) = "" Then
Cells(x, y).NumberFormat = "@"
Cells(x, y).FormulaR1C1 = "==="
End If
Next y
If Qt2 = 9 Then
Qt1 = Qt1
GoTo Fine
Else
Cells(x, 1).NumberFormat = "@"
Cells(x, 1).FormulaR1C1 = "0" & Qt1
Qt1 = Qt1 + 1
End If
End If
Fine:
Next x
End Sub |
Sub cancella()
Range("A9:A16").ClearContents
Range("B9:J16").Select
Selection.Replace What:="===", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.NumberFormat = "General"
End Sub |
Option Explicit
Sub scorri_e_riempi3()
Dim r As Range, x As Long, y As Long, Qt1 As Long, Qt2 As Long, Qt3 As Long
If Cells(9, 1) = "" Then Qt1 = 1 Else Qt1 = Cells(Range("A" & Rows.Count).End(xlUp).Row, 1).Value + 1
For x = 9 To 16
If Application.WorksheetFunction.CountIf(Range("B" & x & ":J" & x), "") = 9 Then
For y = 2 To 10
If Cells(x, y) = "" Then
Cells(x, y).FormulaR1C1 = "'----"
End If
Next y
GoTo Fine
ElseIf Application.WorksheetFunction.CountIf(Range("B" & x & ":J" & x), "") = 0 Then
If Cells(x, 1) = "" Then
Cells(x, 1).FormulaR1C1 = "'0" & Qt1
Qt1 = Qt1 + 1
End If
ElseIf Application.WorksheetFunction.CountIf(Range("B" & x & ":J" & x), "") > 0 Then
For y = 2 To 10
If Cells(x, y) = "" Then
Cells(x, y).FormulaR1C1 = "'----"
End If
Next y
Cells(x, 1).FormulaR1C1 = "'0" & Qt1
Qt1 = Qt1 + 1
ElseIf Application.WorksheetFunction.CountIf(Range("B" & x & ":J" & x), "----") < 9 And Cells(x, 1) = "" Then
Cells(x, 1).FormulaR1C1 = "'0" & Qt1
Qt1 = Qt1 + 1
End If
Next x
Fine:
End Sub
|
