| | Post: 3.318 | Registrato il: 03/04/2013
| Utente Master | Excel 2000 - 2013 | | OFFLINE | |
|
21/03/2019 11:48 | |
Buona giornata, stellablu79;
se ho interpretato correttamenta la tua richiesta, potresti provare questo Codice VBA:
Option Explicit
Sub Report()
Application.ScreenUpdating = False
Dim NRc As Long, x As Long, Rcd As Long
Dim k As Integer, y As Integer, z As Integer
NRc = Range("K" & Rows.Count).End(xlUp).Row
If NRc < 3 Then NRc = 3
Range(Cells(3, 11), Cells(NRc, 13)).ClearContents
NRc = Range("A" & Rows.Count).End(xlUp).Row
Rcd = 3
For x = 2 To NRc
y = Right(Cells(x, 3).Value, 3)
z = Right(Cells(x, 4).Value, 3)
For k = y To z
Cells(Rcd, 11).Value = Cells(x, 1).Value
If k > 99 Then Cells(Rcd, 12).Value = Left(Cells(x, 3).Value, 5) & k
If k < 100 And k > 9 Then
Cells(Rcd, 12).Value = Left(Cells(x, 3).Value, 5) & "0" & k
End If
If k < 10 Then
Cells(Rcd, 12).Value = Left(Cells(x, 3).Value, 5) & "00" & k
End If
Cells(Rcd, 13).Value = Cells(x, 5).Value
Rcd = Rcd + 1
Next k
Next x
Application.ScreenUpdating = True
End Sub
A disposizione.
Buon Lavoro.
Giuseppe
Windows XP - Excel 2000
Windows 10 - Excel 2013 |
|
|