+ Reply to Thread
Results 1 to 7 of 7

Removing Empty cells from database

  1. #1
    Registered User
    Join Date
    09-25-2020
    Location
    vienna
    MS-Off Ver
    365
    Posts
    13

    Removing Empty cells from database

    Dear Members,

    I need your help to fix an issue I have in a Macro.

    I am collecting data from a table (Time sheets) and I need to record the values in a Database (Time sheets registration). The maximum values I am planing to record are 16.
    I have created one macro that inserts 16 new rows in "Time sheets registration", then it copies the data from "time sheets" and will paste it in the database.

    Since the amount of data to be copied is not fixed ( it can be any number between 1 and 16) I have tried to include in my macro a way to select and erase the empty cells. The problem I have is that the macro doesnīt recognize the empty cells.

    is there any way to program the macro to select only cells with information?

    Thanks all in advance
    Attached Files Attached Files
    Last edited by papasioux; 10-02-2020 at 07:47 AM.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Removing Empty cells from database

    Quote Originally Posted by papasioux View Post
    I have tried to include in my macro a way to select and erase the empty cells. The problem I have is that the macro doesnīt recognize the empty cells.
    ideally you shouldn't have the problem, because data like this, IMO, should be listed in a patternized manner anyway. if you did that, say for instance, top to bottom one row at a time, no empty cells would result.

    Quote Originally Posted by papasioux View Post
    is there any way to program the macro to select only cells with information?
    of course. to get a handle on how to recognize empty cells, see this thread which addresses the issue because I was confused about it myself:

    https://www.excelforum.com/excel-pro...th-string.html

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    3,775

    Re: Removing Empty cells from database

    Run this and see if it recognizes the so called empty cells.
    Please Login or Register  to view this content.
    There must be a better way but I don't have all the info I need to suggest that.
    If you supply us with a before and after workbook, someone will come up with a better solution.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    3,775

    Re: Removing Empty cells from database

    Would this be a start of what you want to achieve?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-25-2020
    Location
    vienna
    MS-Off Ver
    365
    Posts
    13

    Re: Removing Empty cells from database

    Dear Jolivanes,

    Thanks for your reply. I have tried to use the code you sent to me but I donīt see any changes. (Sorry, my knowledge about Macros is rather limited ) I will update the file with a new version, adding the after workbook. I guess there is kinda of data linked to the "empty" cells I am copying, eventhough I am pasting them as values only.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    3,775

    Re: Removing Empty cells from database

    Range("B11:E12") from "Time sheet" is copied to the bottom of "Time sheets registration" with the set-up of your attachment with the code from Post #4..
    If that is not what you need, explain what you want to happen.

  7. #7
    Registered User
    Join Date
    09-25-2020
    Location
    vienna
    MS-Off Ver
    365
    Posts
    13

    Re: Removing Empty cells from database

    Hi!

    At the end I added this code to the macro and is working. Thanks for your help

    Please Login or Register  to view this content.

+ 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. Removing empty cells from column
    By NDS123 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-07-2019, 09:17 AM
  2. Replies: 3
    Last Post: 09-21-2015, 08:43 AM
  3. [SOLVED] Macro for removing rows of empty cells within a spreadsheet
    By MrV4Victory in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2013, 09:42 PM
  4. [SOLVED] Linking to column in another Excel file + removing empty cells
    By LmdL in forum Excel General
    Replies: 2
    Last Post: 07-15-2013, 03:13 PM
  5. Removing Colour From Empty Cells
    By jpowell in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-29-2011, 03:12 PM
  6. Removing empty cells
    By crania in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2007, 08:47 PM
  7. Removing '0's' in cells-What is the easiest way to empty these cells?
    By pewe in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-31-2005, 03:05 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