+ Reply to Thread
Results 1 to 8 of 8

Macro to overwrite data on another cell

  1. #1
    Registered User
    Join Date
    09-18-2017
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    13

    Exclamation Macro to overwrite data on another cell

    Hi all,

    I'm fairly new to VBA. I have project for my intern company. I want to overwrite data on another sheet, when I update the data on sheet 1 as an example. I have 17 other individual sheets.on the first sheet contains all my data, exp A-Z. I want to use a filter on sheet 1, let's say for 'A' and overwrite the existing data I have on sheet 2, which contains only data A. After that I go back to sheet 1, and use the filter to get only data B. And then to overwrite the existing data I have on sheet 3 . Etc etc. Thanks.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Macro to overwrite data on another cell

    .
    Here is a portion of the needed code :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-18-2017
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro to overwrite data on another cell

    hi logit, thanks for the code! i was wondering if it was possible to just overwrite the data, and not create a new table? I have hundreds of data on each sheet nad itll be quite confusing to look at if a new table is generated

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Macro to overwrite data on another cell

    .
    Try this :
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-18-2017
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro to overwrite data on another cell

    it is possible to sort it based on column 1 and 2 together?

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Macro to overwrite data on another cell

    .
    As an example for you, I used the MACRO RECORDER. It is very useful when you are not certain what code to write as it will write the code for you.
    It would be a good practice for you to look into it more and experiment.

    This is the macro the RECORDER created :

    Please Login or Register  to view this content.
    This macro is "called" at the very beginning of the code located in MODULE 1 and the macro itself is located at the bottom of MODULE 1.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-18-2017
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    13

    Re: Macro to overwrite data on another cell

    Oh you used macro recording. But then how did you manage to record you creating a new table consisting of data from individual columns? i cant seem time figure how you did that using recording. thanks man

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Macro to overwrite data on another cell

    .
    Creating the new table was done via borrowed code from others on the FORUM and internet as well as gained knowledge.
    Others have stated GOOGLE IS YOUR FRIEND .... very aptly put.

    Cheers

+ 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] Macro Overwrite the data in same sheet
    By murarir in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2015, 09:49 AM
  2. Macro Overwrite the data in same sheet
    By murarir in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-25-2015, 09:34 PM
  3. Macro that does not overwrite data
    By maggi259 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2014, 12:20 PM
  4. [SOLVED] Macro with "save as" --- Need excel to overwrite a file without a prompt to overwrite
    By tsmith1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2012, 10:54 AM
  5. Macro does not overwrite excisting data
    By Mesjoggah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-01-2012, 09:00 AM
  6. Prevent data cell overwrite but allow blank cell overwrite
    By Squasher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2011, 09:24 AM
  7. macro replacing data - want to overwrite
    By Talbot in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2007, 04:41 AM

Tags for this Thread

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