Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

RIPORTARE DEI VALORI IN BASE A DEI RANGE

Ultimo Aggiornamento: 25/03/2019 17:30
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
Vota:
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Cerca nel forum
Tag discussione
Discussioni Simili   [vedi tutte]
Ordine dei valori (3 messaggi, agg.: 20/06/2019 21:57)
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 22:28. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com