+ Reply to Thread
Results 1 to 3 of 3

Formula or code to delete cells if no text is entered inside them

  1. #1
    Registered User
    Join Date
    05-23-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Unhappy Formula or code to delete cells if no text is entered inside them

    Dear Excel Gods,

    I am making a buiness card request form, which I have attached. On the Master Sheet (Sheet 1), the user enters in his/her personal data, such as his name address, phone number, etc. After he/she finished entering all the relevant data, Business Card Layout (Sheet 2) automatically populates and shows the user what their business card will look like.

    Everything works fine, however I just realized that the contact information might vary from person to person. Right now, a person can enter 5 different contact information, but most of them will probably only choose four.

    I wanted to know how to shift the cells down if the user does not fill out one of the contact information. I know that this is a very specific request, but I really would appreciate any advice.

    Thanks,

    Sajan
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-16-2012
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Formula or code to delete cells if no text is entered inside them

    Sub Delete_Rows()
    Dim rng As Range, cell As Range, del As Range
    Set rng = Intersect(Range("D1:D500"), ActiveSheet.UsedRange)
    For Each cell In rng
    If (cell.Value) = " " _
    Then
    If del Is Nothing Then
    Set del = cell
    Else: Set del = Union(del, cell)
    End If
    End If
    Next cell
    On Error Resume Next
    del.EntireRow.Delete
    End Sub

    Not sure if this will help but if you change the range to what ever you column you want to decide has the missing info so eeither column B Oe Column E for you

  3. #3
    Registered User
    Join Date
    05-23-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Formula or code to delete cells if no text is entered inside them

    Thanks for the quick reply, let me try this out and see if it works.

+ 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] Formula needed to only count total cells entered and not count adjacent text entered cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-07-2013, 06:22 PM
  2. [SOLVED] Formula to only calculate totals when text entered in other cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-07-2013, 04:51 PM
  3. [SOLVED] Formula to add values in cells depending on what text is entered in other cells
    By Kayaness in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-09-2013, 05:31 AM
  4. VBA code to set text transparency inside a shape
    By a1s2d3f4 in forum Excel General
    Replies: 1
    Last Post: 01-14-2013, 01:16 PM
  5. VBA code to change font color in range of cells when certain text is entered?
    By BrianG in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-21-2012, 06:30 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