jeudi 20 octobre 2016

VBA Shorten Big Procedure Code

Is there a smarter and shorter way to do this procedure? Thanks

       Allrates.Range("B18").Copy   EURGBP.Cells(EURGBP.Range("D10000").End(xlUp).Row + 1, 4) 'Copies the live spot rate to EURGBP Sheet
       a = Sheets("EURGBP").Range("D" & Rows.Count).End(xlUp).Row 'Finds the last cell with the spot rate in EURGBP Sheet
       Sheets("EURGBP").Range("E" & a).Copy 'will copy the EMA to the Allrates Sheet
       Sheets("Allrates").Range("L18").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
       Sheets("EURGBP").Range("I" & a).Copy 'will copy the Second Upper Band to the Allrates Sheet
       Sheets("Allrates").Range("M18").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
       Sheets("EURGBP").Range("G" & a).Copy 'will copy the Second Lower Band to the Allrates Sheet
       Sheets("Allrates").Range("K18").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
       Sheets("EURGBP").Range("J" & a).Copy 'will copy the Third Upper Band to the Allrates Sheet
       Sheets("Allrates").Range("N18").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
       Sheets("EURGBP").Range("F" & a).Copy 'will copy the Third Lower Band to the Allrates Sheet
       Sheets("Allrates").Range("J18").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False

Aucun commentaire:

Enregistrer un commentaire