+ Reply to Thread
Results 1 to 4 of 4

Special Cells Delete Shift up not consistent

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    Bakersfield, CA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Special Cells Delete Shift up not consistent

    The attached WkBook has two sheets. The macro successfully deletes cells, and shifts up, on the range A1:C10 in Sheet 2, but not on the range B2:AL13 in Sheet1. I can't figure out what the problem is.

    Can someone tell me if there is a reason for the range in Sheet 2 not to be changed by the macros?

    Thank you

    Here's the code
    Please Login or Register  to view this content.

    Thank you for the excellent responses. Fairly new to vba and I enjoy this website.
    Attached Files Attached Files
    Last edited by BHudPE; 01-17-2011 at 03:01 PM. Reason: recd answer

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Special Cells Delete Shift up not consistent

    Hi BHudPE

    I ran your code on Sheet2 and it moved all the numbers up (for the selected range) just like it should.
    Then I tried it on Sheet1 and you are correct - the letters didn't move up.

    THEN I selected all the blank cells on sheet1 and did a Clear Contents on them. Then it worked. It looks like the blank-looking cells on Sheet1 are not blank. I believe this is your problem.

    Write a little code - or in the immediate window try to have it give you back what type of cells they are. I'd bet they aren't xlCellTypeBlanks!

    I hope that helps. I'm always fooled by blank characters that aren't spaces.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Special Cells Delete Shift up not consistent

    hi,

    I don't think I have the answer but I have some suggestions for your code.

    Please Login or Register  to view this content.
    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Special Cells Delete Shift up not consistent

    Try this first, once it has run it will run your code
    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)

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