ho trovato in rete la seguente macro che ho cercato di adattare alle mie esigenze. non ci sono del tutto riuscito e x questo vi chiedo aiuto:
- Codice: Seleziona tutto
Sub cerca1()
Dim sh As Worksheet
Dim rng As Range
Dim c As Range
Set sh = ThisWorkbook.Worksheets("Foglio2")
With sh
Set rng = .Range("A13:a38")
For Each c In rng
If c.Value = Range("g12") Then
MsgBox "GIA' PRESENTE"
Application.CutCopyMode = False
Exit Sub
Exit For
End If
Next
End With
Range("g9").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
With ActiveCell
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End With
End Sub
il suo lavoro lo fa bene tranne in questo punto: If c.Value = Range("g12") Then
vorrei, se fosse possibile, che invece di analizzare una sola cella, lo facesse a un range di celle (ho provato a mettere range("g12:g31") e non fonziona)
grazie anticipatamente per tutti gli aiuti
Edit: Inserito tag CODE. Anthony