• We are receiving reports of members using the private messaging service (Conversations) in ways that break the forum rules:
    • Do not invite another member to take the question off the forum (i.e. do not suggest that they post to a different forum, do not suggest that they email or private message you the problem, do not simply post a link to another forum, unless it is to a specific, relevant, thread). This applies equally to members asking or answering questions.
    • Soliciting business for yourself is not permitted. This is an all volunteer board, so offering solutions in exchange for compensation is not permitted. Likewise, members seeking solutions must not offer compensation for them. If you have an urgent need, check the Consulting Services page.
    Please help us out by clicking the Report link on any messages you receive that violate these rules. Thank you
  • If you would like to post, please check out the MrExcel Message Board FAQ and click here to register.
    If you forgot your password, you can reset your password.

Button to copy value from one cell to another

riskintelligence

New Member
Joined
Oct 24, 2019
Messages
13
Greetings,

Hoping someone can help with a script to make a Button (form control) copy the value from cell D4 and write it into the cell which is referenced as an absolute in cell E4.

I'm not sure if I'm using the right button btw.

Any help appreciated :)
 

footoo

Well-known Member
Joined
Sep 21, 2016
Messages
2,614
Code:
[D4].Copy Range([E4])
Or :
Code:
Range([E4]) = [D4].Value
 
Last edited:

Frank_Excel

New Member
Joined
Jul 27, 2016
Messages
11
Code:
Sub Macro1()    
Range("D4").Select
    Selection.Copy
    Range("E4").Select
    ActiveSheet.Paste
End Sub
 
Last edited:

riskintelligence

New Member
Joined
Oct 24, 2019
Messages
13
Hi Frank,

Your solution copies D4 and pastes into E4. You'll note that E4 contains the reference to the cell where the value in D4 needs to be pasted. footoo's second solution was perfect. But thank you all the same for responding :)

Code:
Sub Macro1()    
Range("D4").Select
    Selection.Copy
    Range("E4").Select
    ActiveSheet.Paste
End Sub
 

Forum statistics

Threads
1,077,965
Messages
5,337,441
Members
399,147
Latest member
Raviteja KOTHA

Some videos you may like

This Week's Hot Topics

Top