fareedexcel
Member
Dear Experts,
I have a table where by entering a number, data will auto populate.
Now the requirement is by clicking a button, those data to be pasted as values in another cell.
Then when entering the next number and clicking the button, the new data to be pasted in the next empty cells. Please help.
This is the code I used to paste the data from the auto populated cell,
I have a table where by entering a number, data will auto populate.
Now the requirement is by clicking a button, those data to be pasted as values in another cell.
Then when entering the next number and clicking the button, the new data to be pasted in the next empty cells. Please help.
This is the code I used to paste the data from the auto populated cell,
Code:
Sub Pastecellvalues()
'Set the cells' values equal to another to paste values
'Set a cell's value equal to another cell's value
Sheets("Data Capture").Range("B1").Copy
Sheets("Data Capture").Range("G4").End(xlUp).Offset(2, 0).PasteSpecial Paste:=xlPasteValues
Sheets("Data Capture").Range("B2").Copy
Sheets("Data Capture").Range("H4").End(xlUp).Offset(2, 0).PasteSpecial Paste:=xlPasteValues
Sheets("Data Capture").Range("B7").Copy
Sheets("Data Capture").Range("I4").End(xlUp).Offset(2, 0).PasteSpecial Paste:=xlPasteValues
Sheets("Data Capture").Range("B8").Copy
Sheets("Data Capture").Range("J4").End(xlUp).Offset(2, 0).PasteSpecial Paste:=xlPasteValues
Sheets("Data Capture").Range("B9").Copy
Sheets("Data Capture").Range("K4").End(xlUp).Offset(2, 0).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub