Partiamo da quello che pensavo di saper fare

In pratica nel foglio di lavoro "Scheda Lavoratore" vorrei riportare alcuni dati presenti in "Sheet" legati al nome del lavoratore selezionato in C6
Lo script che non funziona:
- Codice: Seleziona tutto
Option Explicit
Sub selez() 'seleziona da Anagrafica
Dim UP As String, RA As String, r As Long, uRG As Long, I As Long
Dim Sh As Worksheet, sh1 As Worksheet
Set Sh = Worksheets("Scheda Lavoratore")
Set sh1 = Worksheets("Sheet")
UP = Cells(6, 3) 'assume C6
'cerca in Sheet col. A - B - F - G - H - I - J - L
uRG = sh1.Cells(Rows.Count, 1).End(xlUp).Row
With Sh
.Range("c12:h40").ClearContents
r = 12
For I = 2 To uRG
If UP = sh1.Cells(I, 6) Then 'And RA = sh1.Cells(I, 6) Then 'And sh1.Cells(i, 7) <> "NO"
.Cells(r, 3) = sh1.Cells(I, 1) 'Tipo documento
.Cells(r, 4) = sh1.Cells(I, 2) 'Descrizione tipo documento
.Cells(r, 5) = sh1.Cells(I, 6) 'data Inizio
.Cells(r, 6) = sh1.Cells(I, 8) 'data Scadenza
.Cells(r, 7) = sh1.Cells(I, 12) 'Durata
r = r + 1
End If
Next I
End With
End Sub
Mentre sicuramente avrei chiesto aiuto per questo passaggio.
In pratica se in "sheet" la cella riferita al nome NON è vuota vorrei mettere un visto o una lettera per rendere evidente che vi è associato un allegato.
Lo schema sarebbe il seguente:
In "sheet" colonna ALLEGATO non è vuota scrivo o flaggo la colonna H in "Scheda Lavoratore"
In "sheet" colonna ALLEGATO 1 non è vuota scrivo o flaggo la colonna I in "Scheda Lavoratore"
In "sheet" colonna ALLEGATO 2 non è vuota scrivo o flaggo la colonna J in "Scheda Lavoratore"
https://www.dropbox.com/scl/fi/ub56gu7v3im1fcultqpf4/DBoard-Corsi-VForum.xlsm?dl=0&rlkey=lhgm2hbpbczwlqyl8c4glbdh4
Dato atteso selezionando Baudo Pippo:
https://wtf.roflcopter.fr/pics/5SeuUQZg/jO5vk5Lj?t
Grazie in anticipo per l'aiuto.
Gene