+ Reply to Thread
Results 1 to 9 of 9

Code needed to delete empty cells + adjacent cells

  1. #1
    Registered User
    Join Date
    08-18-2015
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    12

    Code needed to delete empty cells + adjacent cells

    I need code to delete empty cells in a column aling with the 3 cells to the left. Shift up to replace the deleted cells. Please help.
    Last edited by RobinMO01; 08-21-2015 at 03:11 PM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,395

    Re: Please help me, a newbie

    Please read and adhere to these simple rules!

    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. If two or more days have passed, the EDIT button will not appear, and you need to ask a moderator to change the title.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    08-18-2015
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    12

    Re: Code needed to delete empty cells + adjacent cells

    Modified title.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Code needed to delete empty cells + adjacent cells

    This will delete empty cells in Column A. Not sure what you mean by align with three cells to the left? Perhaps you provide a sample showing your data before macro and then after (results), so we can understand your requirements.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-18-2015
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    12

    Re: Code needed to delete empty cells + adjacent cells

    Thanks John. I do not have code yet. Specifically I want to select cells in a range ie f5:f12. Assume f8 and f10 are empty. I want to then delete d8:f8 and d10:f10.
    All help will be greatly appreciated. Thanks.

  6. #6
    Forum Expert
    Join Date
    02-22-2013
    Location
    London / Stockholm
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Code needed to delete empty cells + adjacent cells

    Let's say the column is E, this should do the trick (to test it you can also change .Delete with .Select):
    Please Login or Register  to view this content.

    @JOHN H. DAVIS, seems to me there's no real need to use,
    Please Login or Register  to view this content.
    when
    Please Login or Register  to view this content.
    would do when dealing with Specialcells, as it will only be applied on blank cells in the usedrange? Or is there any other reason to use that?


    Cheers,
    berlan

  7. #7
    Forum Expert
    Join Date
    02-22-2013
    Location
    London / Stockholm
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Code needed to delete empty cells + adjacent cells

    Specifically I want to select cells in a range ie f5:f12. Assume f8 and f10 are empty. I want to then delete d8:f8 and d10:f10.
    Try,
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-18-2015
    Location
    Missouri, USA
    MS-Off Ver
    2010
    Posts
    12

    Re: Code needed to delete empty cells + adjacent cells

    Thanks I will try that

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Code needed to delete empty cells + adjacent cells

    @ berlan - Ha Ha - A matter of habit I guess.

+ 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. Hellos, another newbie here. An old newbie 31 years just started to use VBA!
    By vba_newbie83 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 08-31-2014, 03:37 AM
  2. Newbie
    By mhenders00 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 07-28-2014, 01:05 PM
  3. VBA Newbie
    By MarianneBE in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 07-04-2014, 08:41 AM
  4. Hello Newbie here!
    By monky322 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 06-24-2014, 11:10 PM
  5. Newbie in need off help please?
    By Cudey in forum Excel General
    Replies: 2
    Last Post: 05-01-2012, 09:20 PM
  6. Hello everyone, I'm a newbie here....!
    By jimlp1 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-02-2011, 06:04 PM
  7. Newbie with newbie question
    By elgrandekazoo in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 03-28-2005, 02:13 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