È soltanto un Pokémon con le armi o è un qualcosa di più? Vieni a parlarne su Award & Oscar!
 
Pagina precedente | 1 | Pagina successiva
Vota | Stampa | Notifica email    
Autore

Magazzino

Ultimo Aggiornamento: 15/04/2018 13:29
Post: 3.702
Registrato il: 21/06/2013
Città: NAPOLI
Età: 70
Utente Master
Excel 365
OFFLINE
12/04/2018 11:10

Ciao Enrica ed un saluto a Raffaele.

Volendo si può fare anche con il VBA

Questo codice va nel modulo del foglio "SCARICO"

vb
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ur As Long
Dim rng As Range
Dim cel As Range
If Not Intersect(Target, Range("D:D")) Is Nothing Then
    ur = Sheets("MAGAZZINO").Cells(Rows.Count, 2).End(xlUp).Row
    Set rng = Sheets("MAGAZZINO").Range("B2:B" & ur)
    For Each cel In rng
        If cel.Value = Target.Offset(0, -2).Value Then
            cel.Offset(0, 2).Value = cel.Offset(0, 2).Value - Target.Value
        End If
    Next cel
End If
End Sub


e questo nel modulo del foglio "CARICO"

vb
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ur As Long
Dim rng As Range
Dim cel As Range
If Not Intersect(Target, Range("D:D")) Is Nothing Then
    ur = Sheets("MAGAZZINO").Cells(Rows.Count, 2).End(xlUp).Row
    Set rng = Sheets("MAGAZZINO").Range("B2:B" & ur)
    For Each cel In rng
        If cel.Value = Target.Offset(0, -2).Value Then
            cel.Offset(0, 2).Value = cel.Offset(0, 2).Value + Target.Value
        End If
    Next cel
End If
End Sub

Ti allego il file.
[Modificato da alfrimpa 12/04/2018 11:12]

Alfredo
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]
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 10:26. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com