Hi Excel Masters! - Attempting to write a VBA w/button that can be clicked that would permit roughly 18 specific cells to be copied and pasted into specific cells in specific columns. Each time the button is clicked, the data is copied and pasted in the line below the previous entry. Below is what I have written thus far, which copies the information and pastes it into the first line of where the data needs to be transferred to; however, I am unable to make it so each time the button is clicked, the data is entered in the line below the previous entry. Note: the location where the data is being pulled from is not going to change, only where the data is pasted will change. Here is what I have thus far:
Thank you EXCEL Masters!
VBA Code:
Sub copy_a_range()
Range("C2").Copy
Range("B21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("C5").Copy
Range("C21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("D5").Copy
Range("F21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("D14").Copy
Range("G21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("D16").Copy
Range("I21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("F5").Copy
Range("L21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("F14").Copy
Range("M21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("F16").Copy
Range("O21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("H5").Copy
Range("R21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("H14").Copy
Range("S21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("H16").Copy
Range("U21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("H14").Copy
Range("S21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("J5").Copy
Range("X21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("J14").Copy
Range("Y21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("J16").Copy
Range("AA21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("L5").Copy
Range("AD21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("L14").Copy
Range("AE21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("L16").Copy
Range("AG21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("M5").Copy
Range("AI21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Range("N5").Copy
Range("Ak21").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub
Thank you EXCEL Masters!
Last edited by a moderator: