Salve a tutti.. ho qualche problemino con questo codice in un addin Com che stò scrivendo, in teoria stò cercando di sostituire un testo in tutti i fogli di excel del workbook aperto :
Quando lo eseguo (a parte excel che mi avvisa che in alcuni casi stò lavorando su un foglio vuoto) mi dà errore su 'sh.select' e mi sembra che non sostituisca nullacodice:Dim sh As Worksheet Dim sWhat, sReplace as string sWaht = "prova" sReplace = "Prova Sostituita" For Each sh In application.ActiveWorkbook.Worksheets If sh.Name <> "Protetto" Then On Local Error Resume Next sh.Select application.Selection.Replace What:=sWhat, _ Replacement:=sReplace, _ LookAt:=1, _ SearchOrder:=1, _ MatchCase:=False, _ SearchFormat:=False, _ ReplaceFormat:=False End If Nextnon riesco a trovare niente di utilie sul web poichè fanno riferimento a macro in excel e sembra essere differente come metodo
![]()

non riesco a trovare niente di utilie sul web poichè fanno riferimento a macro in excel e sembra essere differente come metodo
Rispondi quotando