+ Reply to Thread
Results 1 to 3 of 3

VBA insert formula function for certain values in column

  1. #1
    Registered User
    Join Date
    06-18-2019
    Location
    Dallas, Texas
    MS-Off Ver
    windows 2013
    Posts
    72

    VBA insert formula function for certain values in column

    Not sure if anyone will know this but I tried to explain with my exact example. My sheet has around 12 columns but the relevant ones for the question only involve 1-6
    FOR REFFERENCE:
    Column 1 Report ID#
    Column 2 M Date
    Column 3 Report Date
    Column 4 Exec Date
    Column 5 Exec Time
    Column 6 Time diff (the one I am adding the formula in)

    I need just a subtraction formula in column 6, which this isn't hard, but I need to paste the formula in Column 6 certain rows where the column 1 matches the same id number as the above column 1 number.
    For example:
    A2=1
    A3=2
    A4=3
    A5=3
    A6=4
    A7=4

    I would need the formula (in Column 6) for A7-A6 and A5-A4, but not A3-A2 because the column 1 value #'s aren't the same. There is only max 2 of the same Report ID numbers in column 1, but depending on the daily data imputed there would be at least 20 rows where you would need to insert the formula.

  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: VBA insert formula function for certain values in column

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    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
    06-18-2019
    Location
    Dallas, Texas
    MS-Off Ver
    windows 2013
    Posts
    72

    Re: VBA insert formula function for certain values in column

    I added the file. First Page would be the Before and next sheet =After.

    I need to have vba sort the sheet by 'Filter 1' then delete all rows that do not have 'swst' in the filter 1 column. I then need vba to filter by 'filter 2' and delete all values in the column that are not swst BUT NO DELETING BLANK SPACES columns. Then delete the Filter 2 column and have a formula to delete any other column that doesn't have anything in it.

    Next, is to sort by first: TYPE then by: Time diff (smallest to largest)

    That's all I need to finish to help me accelerate the whole daily process.
    Attached Files Attached Files
    Last edited by Tgbell; 06-19-2019 at 01:34 PM.

+ 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] how to insert empty rows based on column B cell values and paste above values with macro?
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2018, 11:47 AM
  2. Replies: 3
    Last Post: 02-14-2016, 07:56 AM
  3. Replies: 2
    Last Post: 12-30-2013, 08:15 AM
  4. Replies: 2
    Last Post: 03-12-2013, 04:10 PM
  5. [SOLVED] Compare 4 column values then insert a 5th columns value to a blank column/cell value
    By JasonKMcCoy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-27-2012, 06:01 PM
  6. [SOLVED] Insert Values from one column based on values from another column
    By adam2308 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-20-2011, 07:09 AM
  7. Insert excel formula using VBA......MATCH function is what i want to insert
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-07-2009, 07:31 PM

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