+ Reply to Thread
Results 1 to 8 of 8

VBA to automatically copy and paste a value based on clicking a cell

  1. #1
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    VBA to automatically copy and paste a value based on clicking a cell

    Hi Experts,

    I am stuck again and could use some help. I think this is possible but I have not been able to get this to work. I have a column N (starting in row 5) that has a dropdown list in the cell. That dropdown list is tied to column CD. That is all working fine. What I need is VBA so that when a user clicks in Column N5 to the end of the list (could be any number of items) Excel automatically copies the value in Column J and places it in CD4 which will automatically update my dropdown list. Below is what I have tried which is not working at all. Any help at all would be greatly appreciated. Let me know if you need more detail.

    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,910

    Re: VBA to automatically copy and paste a value based on clicking a cell

    1) Copy this code.
    2) Right-Click the sheet tab of interest.
    3) Select "View Code"
    4) Paste the code into the window that appears.
    5) Save the file as a macro-enabled .xlsm file.
    6) Make changes as needed


    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: VBA to automatically copy and paste a value based on clicking a cell

    Thanks Bernie,

    I tried the steps and copied the code into my sheet but when I click into N7 it does not take the value from J7 and place it in CD4. I am trying to see what I am doing wrong or need to change. I do have a Macro-enabled spreadsheet. It seems like me clicking on the cells in Column N is not triggering the copy from column J to CD4.

    Thanks again for the help so far. I really appreciate it.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,910

    Re: VBA to automatically copy and paste a value based on clicking a cell

    Run this macro to make sure events are enabled:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: VBA to automatically copy and paste a value based on clicking a cell

    Thanks again. I don't know what I am doing wrong but it still does nothing. I don't know if I am allowed to attach the spreadsheet to my post or not so you could take a look? But, thanks again for everything.

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,910

    Re: VBA to automatically copy and paste a value based on clicking a cell

    To attach a file, click "Go Advanced" and use the "Manage Attachments" link to select and upload your workbook.

  7. #7
    Forum Contributor
    Join Date
    11-08-2012
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    110

    Re: VBA to automatically copy and paste a value based on clicking a cell

    I don't know what happened but it now seems to be working. The file was too large to attach. I reopened and redid the steps you gave me and resaved everything and it started working. Thank you so much.

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,910

    Re: VBA to automatically copy and paste a value based on clicking a cell

    You must have scared it into working!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Automatically copy and paste a row into a new worksheet based on a value
    By mlennox2701 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-08-2017, 07:04 AM
  2. [SOLVED] Automatically copy paste into cells based on cell value
    By Excel_Tim in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2016, 05:26 AM
  3. Replies: 2
    Last Post: 10-09-2014, 09:21 AM
  4. Replies: 7
    Last Post: 08-12-2013, 09:48 AM
  5. Automatically copy and paste rows based on cell value
    By no.18shirt in forum Excel General
    Replies: 3
    Last Post: 06-15-2013, 12:14 AM
  6. Automatically Copy and paste cells based on colour
    By no.18shirt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-02-2013, 04:21 AM
  7. Copy and Paste Cell automatically every 20 mins
    By zit1343 in forum Excel General
    Replies: 4
    Last Post: 04-28-2012, 03:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1