+ Reply to Thread
Results 1 to 12 of 12

Updatable Cell where contents is copied from another cell

  1. #1
    Registered User
    Join Date
    08-01-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    8

    Updatable Cell where contents is copied from another cell

    I have several pages of an excel order form I use at work. In each of these pages it has a location for a Shipping Address, PO, contact...

    I would like to have all pages capture the Information so my user only has to fill it out 1 time. I would also like to make it updateable from any page in the work book (not solely a single page).

    Ex. Customer can change sheet1, C12 and that value will reflect on sheet2, C12 and sheet3, C12. Later when they are on Sheet 3 they can change C12 and it will reflect back on the other 2 sheets with the change.

    I assume the easiest way to do this would be to have a macro or function which collects any changes typed in, adjusts a control cell and then displays the contents of the control cell (not what was typed, which if working correctly would match what is typed because that should replace the control cell contents).

    Not sure how to write such a function. Any help will be appreciated.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Updatable Cell where contents is copied from another cell

    Put this in the ThisWorkbook module. Change the value of sRepRange to suit.

    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    08-01-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Updatable Cell where contents is copied from another cell

    This worked well but I have 4 other areas to do the same thing. I have tried just using the same code with different ranges to do the same thing for the other cells but now I am getting a compile error. How would I use this code for different ranges in the same workbook?

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Updatable Cell where contents is copied from another cell

    As I said, just edit this line:
    Please Login or Register  to view this content.
    Put in the cell addresses you wish to replicate.

    For example:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-01-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Updatable Cell where contents is copied from another cell

    I figured this out. Instead of calling the worksheet event multiple times, I placed the code within the same event. I then changed the range constant name (1,2,3). I removed the redefining of the constants (as they were already defined as data type). I did have to use Terminate(1,2,3) to get this to work as well but in the end it worked.

  6. #6
    Registered User
    Join Date
    08-01-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Updatable Cell where contents is copied from another cell

    Here is my code
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-01-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Updatable Cell where contents is copied from another cell

    Of course, all under workbook change on the top.

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Updatable Cell where contents is copied from another cell

    Ok - no need to repeat the functionality like that. We can just specify the range to replicate:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-01-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Updatable Cell where contents is copied from another cell

    After seeing my code and all my code copying, I am sure there is a better way to do this. If I can leave this cleaner and still functional, that would be best.

    Thank you for your help as I am completely self taught in this project.

  10. #10
    Registered User
    Join Date
    08-01-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Updatable Cell where contents is copied from another cell

    Thanks, my system didn't load your response.

  11. #11
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Updatable Cell where contents is copied from another cell

    Quote Originally Posted by TysonHorlacher View Post
    Of course, all under workbook change on the top.
    Make sure you're using the Workbook_SheetChange event.

    Quote Originally Posted by TysonHorlacher View Post
    After seeing my code and all my code copying, I am sure there is a better way to do this. If I can leave this cleaner and still functional, that would be best.

    Thank you for your help as I am completely self taught in this project.
    Revised code already posted.

  12. #12
    Registered User
    Join Date
    08-01-2017
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Updatable Cell where contents is copied from another cell

    Thanks, my system didn't load your response.

+ 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. [SOLVED] Copied cell contents are centered and should not be
    By iwannabakat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2014, 02:43 PM
  2. Conditional statement w/ copied cell contents
    By mutewitness9 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-14-2014, 12:08 PM
  3. Click on cell to go to worksheet where the cell contents was copied from
    By rikk1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2014, 02:09 PM
  4. Paste copied contents of a cell as a comment in another cell
    By Manjula1 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-07-2012, 09:55 AM
  5. Replies: 3
    Last Post: 01-11-2012, 02:04 PM
  6. Can the contents of a Cell be copied to another Cell by simple Hovering?
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-30-2010, 09:13 AM
  7. How can I allow only cell contents to be copied but not formatting
    By Martin_of_Uxbridge in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-10-2005, 12:06 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