+ Reply to Thread
Results 1 to 10 of 10

VBA delete cells

  1. #1
    Registered User
    Join Date
    01-08-2015
    Location
    Australia
    MS-Off Ver
    Mac 2011
    Posts
    75

    VBA delete cells

    Hi,

    I'm having a little trouble trying to create a macro. I'm new to macros and although I've been able to search the web to create a few that work I don't understand the code.

    In my spreadsheet:

    I have sheet 1 & 2 - these are to input data in.

    1 New & 2 New just merge the name cells into one cell.

    Test puts the students name in the column for their grade under the score that they got.

    I'm trying to delete the cells that return 0 but I don't want the names to move up into the wrong score range.

    Example is what I would like. I will have 8 columns in total once it is complete.

    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA delete cells

    If you delete the rows you'll lose the names, why not just ignore them??
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    01-08-2015
    Location
    Australia
    MS-Off Ver
    Mac 2011
    Posts
    75

    Re: VBA delete cells

    Because it is for others to use and it would be much better without them. Can I delete the cells that contain 0 by a certain range in a column? For example B5:B42 and then B44:B81 and so forth. Might not be the quickest way?

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA delete cells

    Well - it works

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-08-2015
    Location
    Australia
    MS-Off Ver
    Mac 2011
    Posts
    75

    Re: VBA delete cells

    That's great. Thank you very, very much! Is it hard to change the range to B:I?

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA delete cells

    Hi LittleSimon,

    Thanks for the rep!

    I Need to know the specifics - is B the first column and I the last?

    We could use:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-08-2015
    Location
    Australia
    MS-Off Ver
    Mac 2011
    Posts
    75

    Re: VBA delete cells

    Yes I want to delete 0 values in columns B to I as I will add more data so it can be used for upto 8 classes. I would also like to delete these columns if they are empty. I'm not sure where to put this sorry - Cells(i,2).Resize(1,8)
    Thanks again for your help.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA delete cells

    It looks like we'll have to rewrite the program. I don't know when I'll have time. Probably a different approach is needed. I'll ask the other contributors to help

  9. #9
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA delete cells

    Maybe :

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    01-08-2015
    Location
    Australia
    MS-Off Ver
    Mac 2011
    Posts
    75

    Re: VBA delete cells

    Thanks. I've actually nearly finished putting together the sheet as it would need to be. I should have done that before putting it up sorry. I'll attach it when it's done.

+ 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] Delete duplicates and delete empty cells
    By Mengo85 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2015, 07:25 PM
  2. how to delete unwanted cells & delete the rest
    By annux08 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2015, 05:34 AM
  3. delete empty cells in a row, but don't delete the row
    By Megatronixs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2014, 06:03 AM
  4. Delete Cells with Specific Value and All Blank Cells Until Next Populated Cell is Checked
    By rdtrahan1906 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2014, 05:50 PM
  5. [SOLVED] Search for red filles cells or certain text strings cells in Column A and delete row.
    By The Skipper in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2013, 12:57 PM
  6. Replies: 2
    Last Post: 07-25-2013, 01:01 PM
  7. [SOLVED] Find cells which contain specific word, delete cells and shift left.
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-24-2012, 07:00 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