PDA

View Full Version : Solved: need help with command button



niyrho
01-19-2009, 04:20 AM
I need a command button that will copy a cell to the next available cell in another worksheet.

So, lets say sheet 1, a1 is the cell to be copied. On sheet 2 I have a range, say, a1-a100. When I hit the command button I need it to look at sheet 2, a1-a100 and find the first empty cell. Then put the contents of sheet 1, a1 in it.

Simon Lloyd
01-19-2009, 04:29 AM
use it with a button or whatever you like!ActiveCell.Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)if you want to copy the whole row then:

ActiveCell.EntireRow.Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)

niyrho
01-19-2009, 04:46 PM
Thanks, both worked perfect.