ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   copy cell by command button (https://www.excelbanter.com/excel-worksheet-functions/273320-copy-cell-command-button.html)

kalpesh

copy cell by command button
 
Hello,

my probelm is copy cell in other sheet

sheet 1

C5 cell value is 1051


when i click command button this cell value is copy & paste in sheet 2 in
Three Cell like A1 , A2 , A3

& now, agin i enter new value 2510 in C5 cell in sheet 1 is copy &
paste in sheet 2 exact below earlyer paste cell like A4, A5, A6


how it is possible

James Ravenswood

copy cell by command button
 
On Dec 28, 11:31*am, kalpesh
wrote:
Hello,

*my probelm is copy cell in other sheet

*sheet 1

*C5 cell value is * 1051

*when i click command button this cell value is copy & paste in sheet 2 *in
*Three Cell like * A1 *, A2 , A3

*& now, *agin i enter new *value 2510 *in C5 cell in sheet 1 is copy &
*paste in sheet 2 exact below earlyer paste cell like A4, *A5, * A6

*how it is possible


Assign this macro to the command button:

Sub Triplets()
If IsEmpty(Sheets("Sheet2").Range("A1")) Then
n = 1
Else
n = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row + 1
End If
Sheets("Sheet1").Range("C5").Copy Sheets("Sheet2").Cells(n,
1).Resize(3, 1)
End Sub


All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com