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
 

Some videos you may like

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,779
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
 

Watch MrExcel Video

Forum statistics

Threads
1,109,005
Messages
5,526,233
Members
409,689
Latest member
martin_br

This Week's Hot Topics

Top