Command Button (ActiveX Control) and VBAs

mph2010

New Member
Joined
Sep 16, 2010
Messages
10
I have two sheets in my workbook, Sheet 1 & Sheet 2. Sheet one includes several rows of data, spreading out between columns A-G. The G Column is a command button. I want the Command Button to move the data from that row in Sheet 1, to the next available row in Sheet 2. I imagine that a VBA code is the only way to accomplish this task. Thank you
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
What code have you tried?
What are the names of the Command Buttons? What is the relationship between the
CommandButtons and the cell they cover. (No cell ever contains a command button. Command buttons and other controls are in a layer that covers cells.)

Rather than one button per row (on Sheet1), you could have one button (Form control would be easiest) that puts a copy of A-G the row of the Active Cell into Sheet2.
Code:
Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Resize(1, 7).Value = ActiveCell.EntireRow.Range("A1:G1").Value
 
Upvote 0

Forum statistics

Threads
1,215,056
Messages
6,122,907
Members
449,096
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top