+ Reply to Thread
Results 1 to 25 of 25

Macro to turn all blank cells to 1000 and make them white

  1. #1
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Macro to turn all blank cells to 1000 and make them white

    As the title says, I need some help with a macro to make all the blank cells in different sections to the value of "1000" and turn the font to white.
    I already have a code for prioritizing values in different sections, but I would like the values turned to 1000, so that they come up last. Below is the code for my button:
    Please Login or Register  to view this content.
    I want to be able to add to this button so it will do my requested part first, then will follow with what is there at the moment. So basically people will insert their priorities in column A (1, 2, 4, 10, 6) and the code above basically prioritizes it, however I want the users to be able to leave some cells blank and have those moved to the bottom of the section. I thought this would be easiest if I replaced the blank cells with a value of 1000 and make it white so it can't be seen and the prioritize and since I'll never have 1000 priorities it will always show up last. Maybe someone has a better idea?

    -Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    This code will put 1000 in each blank cell in column A and make them white.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    I can't seem to get it to work. If you put values in each different section under column A in the attached excel sheet and run the code in the original post you will see that it organizes everything lowest to highest. I would like to add a condition that anything that is left blank be sent to the bottom. I thought changing all the blank values to 1000 would do that, but it doesn't seem to be working.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    I didn't think the sort would work either but the code I posted does work with your worksheet.

    I think one problem with the sort might be that you don't have more than one area any more, you'll just have one contiguos area.

  5. #5
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    But if I use the original code it can sort by each section. Can I have it just put 1000s in each blank in each section?

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    I know your original code sorts the sections but if you put 1000 in all the blanks in column A you don't have separate sections anymore.

    What is it that's wrong with the original sorting code?

    When I run it the sections are sorted separately.

  7. #7
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    Oh sorry, I might have mis said what I wanted. I wanted to put 1000 in the blank cells in each section, not the entire column. The original code works fine except that I want the blank cells to go to the bottom (but since they are considered 0s they go to the top).

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    What blank cells in the sections?

    There don't apper to be any.

  9. #9
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    Oh sorry I uploaded the a different file. I just deleted random cells in each section, sorry about that.

  10. #10
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    Bump, can someone lend a hand? Thanks!

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    What exactly do you need a hand with?

    The original code works fine, it sorts the sections separately.

  12. #12
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    How do I get it to insert 1000 in the blank cells and then turn them white? (I know the sheet doesn't have any blank cells within the sections, but if there were how would I do it?

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    I've already posted code to do that, and as you found out doing that doesn't seem to help.

  14. #14
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    So this isn't possible?

  15. #15
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    Sorry, what isn't possible?

    I posted code that fills the blanks with 1000 and turns them white, so that's possible.

  16. #16
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    It's not possible to have 1000 posted in each blank cell within each section rather than throughout the entire column? (I know the original file has no blanks, but lets say there was a blank one in a few sections). And also have them with a white font?

  17. #17
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    Yes that should be possible but I don't see how it would make a difference.

    Is there a problem withe he sorting when there are blanks?

  18. #18
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    Quote Originally Posted by Norie View Post
    Yes that should be possible but I don't see how it would make a difference.

    Is there a problem withe he sorting when there are blanks?
    The blanks are moved to the top of the sections, but I want to move all the blanks to the bottom of each section.

  19. #19
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro to turn all blank cells to 1000 and make them white

    Can you attach a workbook with the blanks?

  20. #20
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    Please see the attached file with the blanks in each section under column "A".

    -Thanks
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    08-05-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to turn all blank cells to 1000 and make them white

    thank u very much,i got the solution....,

  22. #22
    Registered User
    Join Date
    08-05-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to turn all blank cells to 1000 and make them white

    thank u very much....

  23. #23
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    Norie,

    I was wondering if you had a chance to look at the sample workbook I posted.

    -Thanks

  24. #24
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Macro to turn all blank cells to 1000 and make them white

    maybe so
    Please Login or Register  to view this content.

  25. #25
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Macro to turn all blank cells to 1000 and make them white

    Nilem, thanks so much it worked perfectly!

    Thank you also to Norie for sticking with me and trying to come up with a solution, I really appreciate it.

+ 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. How can I make a macro ignore blank cells? - Blank Cells have formulas
    By mz1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 08:54 AM
  2. [SOLVED] Macro to turn off 'use 1000 separator'
    By matthew1404 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2013, 08:49 AM
  3. [SOLVED] For all cells with font size bigger than 9, make that cell bold and color white
    By jasondu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2012, 02:18 PM
  4. counting everytime red cells turn white per column
    By alymcmorland in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2005, 06:42 AM
  5. [SOLVED] Why does the blank cells blink black and white on my excel spread.
    By sfulkrod in forum Excel General
    Replies: 2
    Last Post: 02-02-2005, 09:06 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