+ Reply to Thread
Results 1 to 2 of 2

Add new row when a cell changes in a table w/o changing previous row data

  1. #1
    Registered User
    Join Date
    12-10-2019
    Location
    Urbana, OH
    MS-Off Ver
    2016
    Posts
    11

    Add new row when a cell changes in a table w/o changing previous row data

    Hi everyone! I am trying to see if the idea I have is possible. What I am trying to do is take data from an excel worksheet, and move it to another worksheet to create a database with just the data we need. One of the issues I have is, there isn't a viewable database from the calibration software. All I have is one sheet (named CertData) that refreshes with each calibration. I would need to have something that runs in the background looking for a change in CertData sheet (I want to use the ID that increases for each calibration as the trigger which is A39) and then puts this data in a table preferably in another workbook. So I wanted to start a table with the first calibration, and have a blank row below it. Once the next calibration is done, the script will see the ID change, and put that new data in the blank row and create the next empty row ready for the next calibration. Maybe the blank row doesn't need to be there to add the data each time, but I thought it would be an easier trigger to creating new rows (i.e. a script looking for data added in order to create the next row).

    I will say, I am not a master of excel! I can do things here and there and do somewhat advanced things with good research. This one has stopped me dead. I cannot find anything on how to make this work! I can pull data, I can create new rows, but I have no clue how to make it work together. I don't know how to stop a previous row from being overwritten when CertData sheet is updated with a new calibration, and I also couldn't stop it from just creating new rows non stop till it crashes. I can think of how something should be written, but I am failing to find how it has to be written to function. This is where I fail since I am not skilled with VBA.

    The files I have attached are of the data from the software (CertData) and the database I would like to create (Cal files). Nothing is finalized or even remotely close to what I am wanting. This was just a start to see if I could get something rolling. So yes, I know some of what I started wouldn't work, but I just wanted to get information moved to do some trials. The whole reason I am doing this is because I need this database to then create simple text files with the data from the database. It would be used to streamline importing the information into data acquisition system.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Add new row when a cell changes in a table w/o changing previous row data

    What you would want to do as to not overwrite previous row, is find the last row in your table and add below that..
    For me when i need that, i have this in my routine

    Dim LastRow As Long

    ' THIS GET A TOTAL COUNT OF ROWS BASED ON COLUMN A ( Column A for me has a value in each cell, which allows me to determine how far down in the rows i have data)
    LastRow = Range("A" & Rows.Count).End(xlUp).Row

    Then i use it like this anywhere i need to know the row i can use
    .Range("A" & LastRow).PasteSpecial Paste:=xlPasteValues

+ 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. Replies: 2
    Last Post: 07-23-2018, 12:33 PM
  2. Replies: 2
    Last Post: 05-03-2013, 08:47 AM
  3. Auto-move previous content from cell a to cell b by changing cell a
    By Matt81a in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 03:32 PM
  4. fill next blank cell from one cell w/o changing previous cells
    By doodle72 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-07-2013, 12:35 PM
  5. [SOLVED] Changing LOOKUP table prices changes previous sales too!
    By CaneRivero in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 08-04-2012, 11:14 AM
  6. Changing date to next day based on previous cell
    By Willmannyeatthat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2012, 10:17 AM

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