Moderatori: Anthony47, Flash30005
La richiesta e' di avere in L3 in numeri a partire da quanto scritto in I3 e fino a quanto scritto in J3, quindi di quali cele vuote parli?Il loop deve continuare finché non trova le celle vuote.
Sub sebn()
Dim LastI As Long, I As Long, J As Long
'
LastI = Range("I3").End(xlDown).Row
For I = 3 To LastI
If IsNumeric(Cells(I, "I")) And IsNumeric(Cells(I, "J")) Then
mymess = "": DoEvents
For J = Cells(I, "I") To Cells(I, "J")
DoEvents
mymess = mymess & J & "; "
Next J
If Len(mymess) > 3 Then Cells(I, "L") = Left(mymess, Len(mymess) - 2)
End If
Next I
End Sub
Sub sebn2()
Dim LastI As Long, I As Long, J As Long, myLow As Long, myUp As String, myLC As Long
'
myLC = 3
'
LastI = Range("I3").End(xlDown).Row
For I = 3 To LastI
If IsNumeric(CDbl(Cells(I, "I"))) And IsNumeric(CDbl(Cells(I, "J"))) Then
For J = Len(Cells(I, "I")) - 3 To 1 Step -1
If Mid(Cells(I, "I"), J) < "9" Then myLC = Len(Cells(I, "I")) - J + 1: Exit For
Next J
mymess = "": myUp = "": DoEvents
myLow = CLng(Right(Cells(I, "I"), myLC))
If Len(CStr(Cells(I, "I"))) > myLC Then myUp = Left(CStr(Cells(I, "I")), Len(CStr(Cells(I, "I"))) - myLC)
If CLng(Right(Cells(I, "J"), myLC)) < myLow Then mytop = (CLng(Right(Cells(I, "J"), myLC)) + 100000) Else mytop = CLng(Right(Cells(I, "J"), myLC))
For J = myLow To mytop
DoEvents
If myUp = "" Then
mymess = mymess & J & "; "
Else
mymess = mymess & myUp & Format(J, String(myLC, "0")) & "; "
End If
Next J
If Len(mymess) > 3 Then Cells(I, "L") = Left(mymess, Len(mymess) - 2)
End If
Next I
End Sub
Torna a Applicazioni Office Windows
Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 5 |
confrontare e evidenziare 2 fogli excel Autore: niccia |
Forum: Applicazioni Office Windows Risposte: 7 |
Visitano il forum: Nessuno e 44 ospiti