+ Reply to Thread
Results 1 to 3 of 3

Need help with VBA code to perform a calculation, replace cell content and delete row

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Need help with VBA code to perform a calculation, replace cell content and delete row

    I have attached a spreadsheet where I have finished all the macros I needed with the exception of one. When you open the spreadsheet you will see Columns I and L have a negative amount, shown in red. I need to figure out a way to:

    Subtract the negative amount from the cell directly above and calculate the amount
    Replace the amount in the cell directly above the negative amount with the newly calculated amount
    Delete the row that contains the negative amount
    After all calculations are complete, the new totals should match the old totals for Columns I and L

    Sample Worksheet contains the data.
    Sample Worksheet (after) shows how the spreadsheet looks after I manually calculated, replaced and deleted (too time consuming!)

    Any help would be greatly appreciated since I don't know how to go about this piece.
    Attached Files Attached Files

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need help with VBA code to perform a calculation, replace cell content and delete row

    maybe
    Please Login or Register  to view this content.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Need help with VBA code to perform a calculation, replace cell content and delete row

    Wow - that was fast, and it works perfectly. Thanks so much for sharing your knowledge with the vba novices.

+ 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] Display content of cell if other cells are empty otherwise perform SUM
    By peakoverload in forum Excel General
    Replies: 2
    Last Post: 07-16-2012, 06:04 AM
  2. Replies: 5
    Last Post: 01-28-2011, 07:02 PM
  3. [SOLVED] what code can delete cell content
    By colwyn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2008, 08:19 AM
  4. Option button (active control) code to perform a calculation
    By Taggsuk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2008, 07:00 PM
  5. Perform a calculation only once on a cell
    By ndavies in forum Excel General
    Replies: 0
    Last Post: 01-24-2005, 06:48 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