
1)
If CellaA.Offset(0, 3).Value Like "%tuta%" Then
presenza_tuta = True
Else
presenza_tuta = False
End If
###################
2)
If CellaA.Offset(0, 3).Find("%tuta%", LookIn:=xlValues) Then
presenza_tuta = True
Else
presenza_tuta = False
End If
3) presenza_tuta = CellaA.Offset(0, 3).Find("%tuta%", LookIn:=xlValues)
If presenza_tuta = True Then
sh1.Range("M1").Value = "trovata"
Else
sh1.Range("M2").Value = "non trovata"
End If
|
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
Sub analisi_integrità()
Dim sh1 As Worksheet
Dim range_da_usare As Range
Dim ultimariga As Integer
Dim numero_tute As Integer
Set sh1 = Worksheets("anagrafica")
Set ultimariga = sh1.Range("D65536").End(xlUp).Row
Set range_da_usare = sh1.Range("D2:" & ultimariga)
Set numero_tute = sh1.range_da_usare.Find("*tuta*", LookIn:=xlValues).Count
sh1.Range("P1").Value = numero_tute
End Sub |
Sub prova() |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
Sub analisi_integrità()
Dim sh1 As Worksheet
Dim range_da_usare As Range
Dim ultimariga As Integer
Dim numero_tute As Integer
Set sh1 = Worksheets("anagrafica")
ultimariga = sh1.Range("D65536").End(xlUp).Row
Set range_da_usare = sh1.Range("D2:" & ultimariga)
Set numero_tute = sh1.range_da_usare.Find("*tuta*", LookIn:=xlValues).Count
sh1.Range("P1").Value = numero_tute
End Sub |
Set range_da_usare = sh1.Range("D2:D" & ultimariga) |
| scossa's web site |
| Se tu hai una mela, ed io ho una mela, e ce le scambiamo, allora tu ed io abbiamo sempre una mela per uno. Ma se tu hai un'idea, ed io ho un'idea, e ce le scambiamo, allora abbiamo entrambi due idee. (George Bernard Shaw) |
Option Explicit
Sub analisi_integrità()
Dim sh1 As Worksheet
Dim range_da_usare As Range
Dim ultimariga As Integer
Dim numero_tute As Long
Set sh1 = Worksheets("anagrafica")
ultimariga = sh1.Range("D65536").End(xlUp).Row
Set range_da_usare = sh1.Range("D2:D" & ultimariga)
numero_tute = sh1.range_da_usare.Find("*tuta*", LookIn:=xlValues).Count
sh1.Range("P1").Value = numero_tute
End sub |
numero_tute = range_da_usare.Find("*tuta*", LookIn:=xlValues).Count |
Option Explicit
Sub analisi_integrità()
Dim sh1 As Worksheet
Dim range_da_usare As Range
Dim ultimariga As Integer
Dim numero_tute As Long
Set sh1 = Worksheets("anagrafica")
ultimariga = sh1.Range("D65536").End(xlUp).Row
Set range_da_usare = sh1.Range("D2:D" & ultimariga)
numero_tute = range_da_usare.Find("*tuta*", LookIn:=xlValues).Count
sh1.Range("P1").Value = numero_tute
End Sub |
Option Explicit
Sub analisi_integrità()
Dim sh1 As Worksheet
Dim range_da_usare As Range
Dim ultimariga As Integer
Dim item_found As Range, first_found As String, numero_tute As Long
Set sh1 = Worksheets("anagrafica")
ultimariga = sh1.Range("D65536").End(xlUp).Row
Set range_da_usare = sh1.Range("D2:D" & ultimariga)
numero_tute = 0
With range_da_usare
Set item_found = .Find("tuta", LookIn:=xlValues, LookAt:=xlPart)
If Not item_found Is Nothing Then
first_found = item_found.Address
Do
Set item_found = .FindNext(item_found)
numero_tute = numero_tute + 1
Loop While Not item_found Is Nothing And item_found.Address <> first_found
End If
End With
sh1.Range("P1").Value = numero_tute
End Sub |
