macros

J

JOHN

If I have a macro that copies A1 and pastes it into b1, how can I change the
macro to paste it into any selected cell?
 
L

L. Howard Kittle

Hi HOHN,

Try one of these...

Sub S_Copy()
ActiveCell.Value = Range("A1").Value
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Value = Range("A1").Value
End Sub

Where you will have to activate the S_Copy() macro with a button or such and
the Selection_Change macro will copy A1 th the cell you click on.

HTH
Regards,
Howard
 
J

JOHN

My father always said..."Call me by any name, Just never call me late for
dinner....
Thanks again for your help.
 
J

JOHN

This is a copy of the macro, where do I put in your suggested changes?
I am coping row 5, columns A:V and pasting them into cj3. I want to change
CJ3 to any selected cell.

Sub JOHN()
'
' JOHN Macro
''
Range("A5:V5").Select
Selection.Copy
Range("CJ3").Select
ActiveSheet.Paste
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top