+ Reply to Thread
Results 1 to 4 of 4

Stop VBA Module erasing data

  1. #1
    Registered User
    Join Date
    03-11-2019
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    2

    Stop VBA Module erasing data

    Hello all,

    I've copied a module I found on ExtendOffice and modified it to suit my needs. When I click a button, it pulls all unique Employee IDs from column C of data exported from FileMaker (RawData!). It pastes these unique values in column A of a table on a different sheet (MainTool!).

    The table in the main tool then uses the Employee IDs to cross reference the RawData for more information using an index match.

    While the code works great and does exactly what I want it to, it also deletes all values and formulas (including all my index match stuff) in columns F onward.

    I'd like it to only replace the data in column A without deleting anything.

    Please Login or Register  to view this content.
    If there's no values in column A before pressing the button, the module works fine. But if I need to update the values already in the Main Tool and press the button again, here's what happens (Employee names & table headers erased):

    sample.JPG

    I think it erases all of my formulas because it's deleting duplicates, but even changing where it copies the range (xRng.Copy Range("A8")) to a cell below the original unique values (I have 97 unique values; I changed Range("A8") to Range("A105")) in the hopes of having the macro delete duplicates below the ones connected to formulas did not work.

    Any help is greatly appreciated.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,333

    Re: Stop VBA Module erasing data

    Let's try this for starters.

    Please Login or Register  to view this content.
    Last edited by bakerman2; 03-11-2019 at 05:20 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    03-11-2019
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    2

    Re: Stop VBA Module erasing data

    Hello bakerman2,

    That seems to have worked! Thank you so much for your help.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,333

    Re: Stop VBA Module erasing data

    Glad to help and thanks for feedback.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. eRASING SPECIFIC DATA FROM CEL ON MULTIPLE CELLS
    By JOERIVL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2017, 08:28 AM
  2. [SOLVED] Stop Calc 'Worksheet' Module!
    By Keibri in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2016, 10:23 AM
  3. [SOLVED] VBA to copy value from cells in 1 worksheet to another, but without erasing existing data
    By jskellington2021 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2016, 05:26 AM
  4. [SOLVED] Macro Code Will Not Stop Saving In My Module
    By TBM in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-12-2016, 01:22 PM
  5. Problem with data transfer (erasing old data)
    By SoloMon3y in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2015, 03:14 PM
  6. Web data to excel without erasing while refreshing
    By Afroo in forum Excel General
    Replies: 2
    Last Post: 03-25-2015, 02:40 AM
  7. clear texboxes and lists without erasing data in spreadsheet
    By keiperg813 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 05:49 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