![]() ![]() A1:C17 is the range you need to copy, and J1:L17 is the destination range to paste data. Note: In the code, CommandButton1 is the name of your inserted Command Button. XSheet.Range("J1:L17").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False If xSheet.Name "Definitions" And xSheet.Name "fx" And xSheet.Name "Needs" Then VBA code: Use Command Button to copy and paste data in Excel Private Sub CommandButton1_Click() In the popping up Microsoft Visual Basic for Applications window, please replace the original code in the Code window with below VBA code. Select View Code from the context menu.ģ. Draw a Command Button in your worksheet and right click it. Insert a Command Button by clicking Developer > Insert > Command Button (ActiveX Control). Please do as follows to copy and paste data automatically when clicking a Command Button.ġ. How to make this copy and paste affair running automatically? This article will show you how to use a command button to copy and paste data with only one click.Ĭreate a Command Button to copy and paste data with VBA code Supposing you need to frequently copy a range of cells to other place after changing the data, the manually copy and paste method will be fussy and time-consuming. ![]() How to create a Command Button to copy and paste data in Excel? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |