
[Sub Macro1() 'Dim B(100) As Variant Static B(100) B(i) = Array(100) Cells(7, 14) = "" For i = 1 To 200 ' converte le prime lettere in maiuscolo titdacontr = StrConv(Cells(4, 14), vbProperCase) a = titdacontr 'b(i)= cells If B(i) = a Then Cells(7, 14) = "Esiste già!": GoTo fine: If B(i) = 0 Then B(i) = a: GoTo fine1 Next i fine: Cells(4, 14) = "": GoTo fine2 fine1: Cells(7, 14) = "OK" fine2: End Sub alpha45 New Entry Messaggi: 1 Iscritto il: 16 set 2009, 11:42 Messaggio privato |
'Inserisci tutto in modulo standard Public MatriceRecuperata() Sub MatriceInTesto() 'ad ogni chiamata cancella il vecchio file txt fn = FreeFile Open ActiveWorkbook.Path & "" & "Matrice" & ".txt" For Output As #fn For I = LBound(TuaMatrice) To UBound(TuaMatrice) Print #fn, TuaMatrice(I) Next I Close #fn End Sub Sub TestoInMatrice() 'scrivi il nome di questa macro nell'evento open in thisworkbook Dim a As String fn = FreeFile Open ActiveWorkbook.Path & "" & "Matrice" & ".txt" For Input As #fn Do Until EOF(fn) Line Input #1, a ReDim Preserve MatriceRecuperata(I) MatriceRecuperata(I) = a$ I = I + 1 Loop Close #fn End Sub |
