+ Reply to Thread
Results 1 to 2 of 2

Insert EntireRow (above of) if cell/s below HasFormula

  1. #1
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Manila, Philippines
    MS-Off Ver
    2019
    Posts
    102

    Insert EntireRow (above of) if cell/s below HasFormula

    Hello Excel gurus!

    As the title suggests, it seems pretty simple. But I did some trial and error and I can't seem to get the right codes in place to achieve that. Basically what I want is:
    • Sheet1.Range("A3:E3") have Sum formula
    • On onclick button event, a Userform1 will launch asking for inputs for Headers 1 to 5
    • The code will check for empty row, if it spots one, it will send the data to specified range in the code
    • If the program spots a formula in a range of cells (by checking the ActiveCell), it will insert an entire row above, and sends there the data from Userform1
    • The cells (or range) with formula will move 1 row below and calculates values per column
    • And so on

    Here's the code:
    Please Login or Register  to view this content.
    I am attaching the file I am working on for better understanding of the requirement.

    If you can come up with more simple code structure, I would be happy to learn from you.

    Testing Insert Rows Macro.xlsm

    Hope you guys can help me with this.

    Thanks!!
    Attached Files Attached Files
    Last edited by ykobure; 04-02-2015 at 08:43 AM.

  2. #2
    Forum Contributor
    Join Date
    08-29-2012
    Location
    Manila, Philippines
    MS-Off Ver
    2019
    Posts
    102

    Re: Insert EntireRow (above of) if cell/s below HasFormula

    Maybe I should have waited a bit more before posting. I managed to solve my problem.

    Sharing with you my solution:
    • No significant changes in the VB code, except from removing unnecessary comments
    • The fix is on the =Sum( ) formula

    Instead of using the default formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I used:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hope this can be of help to others!

+ 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] EntireRow.Insert with conditions vs a match VB code
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-15-2013, 03:18 PM
  2. [SOLVED] Change/replace vb code .EntireRow.Insert (2007)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-25-2012, 07:46 AM
  3. [SOLVED] Selection.EntireRow.Insert Inserts too many Rows!
    By nickv02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2012, 11:40 AM
  4. Insert EntireRow
    By matrixknow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2007, 06:23 AM
  5. HasFormula protect cell
    By SIGE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-19-2005, 01:06 PM

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