+ Reply to Thread
Results 1 to 6 of 6

remove formula blanks without loop

  1. #1
    Registered User
    Join Date
    05-20-2020
    Location
    UK
    MS-Off Ver
    Office 16
    Posts
    33

    remove formula blanks without loop

    I have some VBA that copies used cells into another sheet 'register' (among other things). It ends by bringing the user to last used row in register. Unfortunately because there is a formula in the first sheet (Get new oracs2) it seems to copy a blank row every time the macro is run (which carries out other updates as well). This means that when there is new numbers to add it leaves blank rows in the register. To get round this I have a loop 'remove blanks added by formula but this unfortunately takes a long time to run. Can anyone suggest an alternative to the loop that would clear the blanks? The formula pulls the results through from a query
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: remove formula blanks without loop

    This will delete all rows with a blank in column A. No Loops. Fast.

    Please Login or Register  to view this content.

    It looks complicated but isn't.

    Last Row:
    Please Login or Register  to view this content.
    Select All Blanks
    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    05-20-2020
    Location
    UK
    MS-Off Ver
    Office 16
    Posts
    33

    Re: remove formula blanks without loop

    Hi Firstly thank you for replying so fast and your interest, I didnt expect a reply so soon. Unfortunately it didnt work as I would like it to. The first time I ran it (which shouldnt really be any different to subsequent - as the query has not pulled through anything different) it ran but didnt delete the blank and hence the cursor ended up in a blank row rather than the last used. On subsequent times it gives me a run time error 1004 - No cells were found, yet if I count the rows(by selecting them all) in 'get oracs2' there are 125, all with nothing in other than a formula

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: remove formula blanks without loop

    Welcome to the forum

    Please 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.

  5. #5
    Registered User
    Join Date
    05-20-2020
    Location
    UK
    MS-Off Ver
    Office 16
    Posts
    33

    Re: remove formula blanks without loop

    Ok, I'll have to see if I can recreate this on my home computer (which will be in Excel 2007 and take a little more time), work protocols and firewalls will prevent me from uploading (or emailing out) even a sanitized version of the workbook. I'll mimic the query using a table - s*ds law it will probably all work outside of my actual workbook!

  6. #6
    Registered User
    Join Date
    05-20-2020
    Location
    UK
    MS-Off Ver
    Office 16
    Posts
    33

    Re: remove formula blanks without loop

    Hi

    I've attached a sample I've mocked up on 2007 which is similar to the relevant sheets on my workbook. I've inserted a table to represent the query. This works with the loop and first time with your suggested formula but not thereafter. The user could run the macro even when there is nothing in the query/table (as the macro does other things - NB I've deleted these out of the sample workbook query) Many thanks
    Attached Files Attached Files

+ 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: 9
    Last Post: 01-18-2018, 03:00 AM
  2. Remove Blanks With Dynamic Named Range - Error with the formula
    By Tepsjen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-23-2014, 05:34 PM
  3. [SOLVED] Sort results of INDEX/MATCH array formula remove blanks. . .
    By PeteABC123 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-14-2014, 01:53 PM
  4. [SOLVED] Remove Blank Cells Formula when prior formula returns blanks
    By gmsninja in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-13-2013, 03:39 AM
  5. Array formula to remove blanks (like autofilter)
    By CST in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2012, 12:54 PM
  6. Array formula to remove blanks needs to work in 2003
    By Chinchin in forum Excel General
    Replies: 3
    Last Post: 08-26-2011, 09:15 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