I need a macro that copies that data from one cell on one sheet to a cell on another?

  • Thread starter Thread starter cakonopka
  • Start date Start date
C

cakonopka

Hi there all

a problary most simple thing for you, im looking for a macro where t
will move the data from one cell to another when i click it, thats it
i know there is problary some simple thing but i dont know it, lol.

if u cant do it please let me know so i can stop trying, lol

cheers

from c
 
Private Sub CommandButton1_Click()
Range("A1").Copy Destination:=Range("B9"
Range("A1").ClearContents
End Sub
 
I guess cakonopka meant "when i click the cell", didn't you ?
So is there a way to make SUBs on the events On_click in a cell ?


Tom Ogilvy said:
Private Sub CommandButton1_Click()
Range("A1").Copy Destination:=Range("B9"
Range("A1").ClearContents
End Sub
 
Tom,

would you please expalin the first row of your
reply...what is Private Sub, etc.?
 
Sub test()
Set srcSht = Sheets("Sheet1")
Set tgtSht = Sheets("Sheet2")
'will copy A1 to A1...
tgtSht.[a1] = srcSht.[a1]
'will copy data in column A to column C....
tgtSht.Range("C1:C" & srcSht.[a65536].End(3).Row) = _

srcSht.Range("A1:A" & srcSht.[a65536].End(3).Row).Value
End Sub
 
In a previous post he said click on a button.


You can use the selectionchange event to trigger an action on cell
selection, but this is usually clumsy and works whenever the cell is
entered, even if not with a mouse click.

--
Regards,
Tom Ogilvy


David said:
I guess cakonopka meant "when i click the cell", didn't you ?
So is there a way to make SUBs on the events On_click in a cell ?
 
Put a command button on the sheet and double click on it.

You will see much the same.
 
Hi there

yep u were right i did want ti when i clicka button i will try it an
see if ti works ok if i need any more ill get back to you all, an
cheers again very much t you all for your help.

Cheers

From C
 
Hi ther all

that ahs worked great but i need to add a bit to it so that once i have
clicked the button and it has moved all of the data it iserts a new row
above, lol, any idea on this anyone, that way each time new data is
entered the rest is moved down and the new data is at the top of the
list, lol, if u know what i mean.

cheers

from CK

This is all very much appreciated, thats everyone so much
 
Back
Top