+ Reply to Thread
Results 1 to 29 of 29

Automatic coloring of blank cells when sheet work complete

  1. #1
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi bigdaddy3

    With code

    On Error Resume Next
    ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    On Error GoTo 0

    Mnual

    Select your data
    F5
    Special..Blanks
    OK
    Choose a color in the formatting toolbar



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >i would like to automatically color all blank cells unfilled which can vary
    > on each sheet at close of workbook,any suggestions .The total number of blank
    > cells will be no more than 100
    > --
    > BD3




  2. #2
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Thanks ron that works a treat
    --
    BD3


    "Ron de Bruin" wrote:

    > You can use a range like this
    >
    > Range("A6:G100") instead of UsedRange
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > ron ,yes in those tot 5 rows is information ie company name,address etc and
    > > are already coloured and i dont want those affected as they are on a template
    > > and give me a new sheet to be filled in every time that is why i need to be
    > > able to color below that down to row say 100. Both the sheet and workbook are
    > > locked in excel leaving just a certain no of cells to be filled in but if
    > > they are not thats why i want to color just the unfilled ones which can be
    > > different every time, i hope this makes sense
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> When you use the code to protect you can use a password if you want
    > >>
    > >> Sh.Protect Password:="ron", userinterfaceonly:=True
    > >>
    > >> > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > >> > columns a to p and then only down as far as row 100,also as far as the
    > >> > protected sheet goes it unprotects to
    > >>
    > >> Can you explain more ?
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > >> > columns a to p and then only down as far as row 100,also as far as the
    > >> > protected sheet goes it unprotects to fill but i would like it protected
    > >> > again when finished with the original password. any thoughts
    > >> > --
    > >> > BD3
    > >> >
    > >> >
    > >> > "Ron de Bruin" wrote:
    > >> >
    > >> >> Hi
    > >> >>
    > >> >> Protect your sheets with code like this in the open event
    > >> >>
    > >> >> Private Sub Workbook_Open()
    > >> >> Dim Sh As Worksheet
    > >> >> Application.ScreenUpdating = False
    > >> >> For Each Sh In ThisWorkbook.Worksheets
    > >> >> Sh.Protect userinterfaceonly:=True
    > >> >> Next
    > >> >> Application.ScreenUpdating = True
    > >> >> End Sub
    > >> >>
    > >> >>
    > >> >> >and then when i do it even colors in some of my headings that
    > >> >> > are part of an initial template ive created.
    > >> >>
    > >> >> You can adapt the range
    > >> >> sh.UsedRange
    > >> >>
    > >> >>
    > >> >>
    > >> >> --
    > >> >> Regards Ron de Bruin
    > >> >> http://www.rondebruin.nl
    > >> >>
    > >> >>
    > >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >> > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > >> >> > unprotect it and then when i do it even colors in some of my headings that
    > >> >> > are part of an initial template ive created.
    > >> >> > --
    > >> >> > BD3
    > >> >> >
    > >> >> >
    > >> >> > "Ron de Bruin" wrote:
    > >> >> >
    > >> >> >> Hi BD3
    > >> >> >>
    > >> >> >> You can run it in a event in the thisworkbook module
    > >> >> >>
    > >> >> >> This event will run when you save your workbook
    > >> >> >>
    > >> >> >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > >> >> >> Dim sh As Worksheet
    > >> >> >> For Each sh In ThisWorkbook.Worksheets
    > >> >> >> On Error Resume Next
    > >> >> >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> >> On Error GoTo 0
    > >> >> >> Next sh
    > >> >> >> End Sub
    > >> >> >>
    > >> >> >> See this page about events
    > >> >> >> http://www.cpearson.com/excel/events.htm
    > >> >> >>
    > >> >> >>
    > >> >> >> --
    > >> >> >> Regards Ron de Bruin
    > >> >> >> http://www.rondebruin.nl
    > >> >> >>
    > >> >> >>
    > >> >> >> "bigdaddy3" <[email protected]> wrote in message
    > >> >> >> news:[email protected]...
    > >> >> >> > Hi ron, where would i insert that code.
    > >> >> >> > --
    > >> >> >> > BD3
    > >> >> >> >
    > >> >> >> >
    > >> >> >> > "Ron de Bruin" wrote:
    > >> >> >> >
    > >> >> >> >> Hi bigdaddy3
    > >> >> >> >>
    > >> >> >> >> With code
    > >> >> >> >>
    > >> >> >> >> On Error Resume Next
    > >> >> >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> >> >> On Error GoTo 0
    > >> >> >> >>
    > >> >> >> >> Mnual
    > >> >> >> >>
    > >> >> >> >> Select your data
    > >> >> >> >> F5
    > >> >> >> >> Special..Blanks
    > >> >> >> >> OK
    > >> >> >> >> Choose a color in the formatting toolbar
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >> --
    > >> >> >> >> Regards Ron de Bruin
    > >> >> >> >> http://www.rondebruin.nl
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >> "bigdaddy3" <[email protected]> wrote in message
    > >> >> >> >> news:[email protected]...
    > >> >> >> >> >i would like to automatically color all blank cells unfilled which can vary
    > >> >> >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> >> >> >> > cells will be no more than 100
    > >> >> >> >> > --
    > >> >> >> >> > BD3
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  3. #3
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    You can use a range like this

    Range("A6:G100") instead of UsedRange

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > ron ,yes in those tot 5 rows is information ie company name,address etc and
    > are already coloured and i dont want those affected as they are on a template
    > and give me a new sheet to be filled in every time that is why i need to be
    > able to color below that down to row say 100. Both the sheet and workbook are
    > locked in excel leaving just a certain no of cells to be filled in but if
    > they are not thats why i want to color just the unfilled ones which can be
    > different every time, i hope this makes sense
    > --
    > BD3
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> When you use the code to protect you can use a password if you want
    >>
    >> Sh.Protect Password:="ron", userinterfaceonly:=True
    >>
    >> > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    >> > columns a to p and then only down as far as row 100,also as far as the
    >> > protected sheet goes it unprotects to

    >>
    >> Can you explain more ?
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    >> > columns a to p and then only down as far as row 100,also as far as the
    >> > protected sheet goes it unprotects to fill but i would like it protected
    >> > again when finished with the original password. any thoughts
    >> > --
    >> > BD3
    >> >
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> >> Hi
    >> >>
    >> >> Protect your sheets with code like this in the open event
    >> >>
    >> >> Private Sub Workbook_Open()
    >> >> Dim Sh As Worksheet
    >> >> Application.ScreenUpdating = False
    >> >> For Each Sh In ThisWorkbook.Worksheets
    >> >> Sh.Protect userinterfaceonly:=True
    >> >> Next
    >> >> Application.ScreenUpdating = True
    >> >> End Sub
    >> >>
    >> >>
    >> >> >and then when i do it even colors in some of my headings that
    >> >> > are part of an initial template ive created.
    >> >>
    >> >> You can adapt the range
    >> >> sh.UsedRange
    >> >>
    >> >>
    >> >>
    >> >> --
    >> >> Regards Ron de Bruin
    >> >> http://www.rondebruin.nl
    >> >>
    >> >>
    >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> >> > Hi ron, tried that but as the worksheet is protected it wont work unless i
    >> >> > unprotect it and then when i do it even colors in some of my headings that
    >> >> > are part of an initial template ive created.
    >> >> > --
    >> >> > BD3
    >> >> >
    >> >> >
    >> >> > "Ron de Bruin" wrote:
    >> >> >
    >> >> >> Hi BD3
    >> >> >>
    >> >> >> You can run it in a event in the thisworkbook module
    >> >> >>
    >> >> >> This event will run when you save your workbook
    >> >> >>
    >> >> >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    >> >> >> Dim sh As Worksheet
    >> >> >> For Each sh In ThisWorkbook.Worksheets
    >> >> >> On Error Resume Next
    >> >> >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> >> On Error GoTo 0
    >> >> >> Next sh
    >> >> >> End Sub
    >> >> >>
    >> >> >> See this page about events
    >> >> >> http://www.cpearson.com/excel/events.htm
    >> >> >>
    >> >> >>
    >> >> >> --
    >> >> >> Regards Ron de Bruin
    >> >> >> http://www.rondebruin.nl
    >> >> >>
    >> >> >>
    >> >> >> "bigdaddy3" <[email protected]> wrote in message
    >> >> >> news:[email protected]...
    >> >> >> > Hi ron, where would i insert that code.
    >> >> >> > --
    >> >> >> > BD3
    >> >> >> >
    >> >> >> >
    >> >> >> > "Ron de Bruin" wrote:
    >> >> >> >
    >> >> >> >> Hi bigdaddy3
    >> >> >> >>
    >> >> >> >> With code
    >> >> >> >>
    >> >> >> >> On Error Resume Next
    >> >> >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> >> >> On Error GoTo 0
    >> >> >> >>
    >> >> >> >> Mnual
    >> >> >> >>
    >> >> >> >> Select your data
    >> >> >> >> F5
    >> >> >> >> Special..Blanks
    >> >> >> >> OK
    >> >> >> >> Choose a color in the formatting toolbar
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >> >> --
    >> >> >> >> Regards Ron de Bruin
    >> >> >> >> http://www.rondebruin.nl
    >> >> >> >>
    >> >> >> >>
    >> >> >> >> "bigdaddy3" <[email protected]> wrote in message
    >> >> >> >> news:[email protected]...
    >> >> >> >> >i would like to automatically color all blank cells unfilled which can vary
    >> >> >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    >> >> >> >> > cells will be no more than 100
    >> >> >> >> > --
    >> >> >> >> > BD3
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  4. #4
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    ron ,yes in those tot 5 rows is information ie company name,address etc and
    are already coloured and i dont want those affected as they are on a template
    and give me a new sheet to be filled in every time that is why i need to be
    able to color below that down to row say 100. Both the sheet and workbook are
    locked in excel leaving just a certain no of cells to be filled in but if
    they are not thats why i want to color just the unfilled ones which can be
    different every time, i hope this makes sense
    --
    BD3


    "Ron de Bruin" wrote:

    > When you use the code to protect you can use a password if you want
    >
    > Sh.Protect Password:="ron", userinterfaceonly:=True
    >
    > > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > > columns a to p and then only down as far as row 100,also as far as the
    > > protected sheet goes it unprotects to

    >
    > Can you explain more ?
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > > columns a to p and then only down as far as row 100,also as far as the
    > > protected sheet goes it unprotects to fill but i would like it protected
    > > again when finished with the original password. any thoughts
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi
    > >>
    > >> Protect your sheets with code like this in the open event
    > >>
    > >> Private Sub Workbook_Open()
    > >> Dim Sh As Worksheet
    > >> Application.ScreenUpdating = False
    > >> For Each Sh In ThisWorkbook.Worksheets
    > >> Sh.Protect userinterfaceonly:=True
    > >> Next
    > >> Application.ScreenUpdating = True
    > >> End Sub
    > >>
    > >>
    > >> >and then when i do it even colors in some of my headings that
    > >> > are part of an initial template ive created.
    > >>
    > >> You can adapt the range
    > >> sh.UsedRange
    > >>
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > >> > unprotect it and then when i do it even colors in some of my headings that
    > >> > are part of an initial template ive created.
    > >> > --
    > >> > BD3
    > >> >
    > >> >
    > >> > "Ron de Bruin" wrote:
    > >> >
    > >> >> Hi BD3
    > >> >>
    > >> >> You can run it in a event in the thisworkbook module
    > >> >>
    > >> >> This event will run when you save your workbook
    > >> >>
    > >> >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > >> >> Dim sh As Worksheet
    > >> >> For Each sh In ThisWorkbook.Worksheets
    > >> >> On Error Resume Next
    > >> >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> On Error GoTo 0
    > >> >> Next sh
    > >> >> End Sub
    > >> >>
    > >> >> See this page about events
    > >> >> http://www.cpearson.com/excel/events.htm
    > >> >>
    > >> >>
    > >> >> --
    > >> >> Regards Ron de Bruin
    > >> >> http://www.rondebruin.nl
    > >> >>
    > >> >>
    > >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >> > Hi ron, where would i insert that code.
    > >> >> > --
    > >> >> > BD3
    > >> >> >
    > >> >> >
    > >> >> > "Ron de Bruin" wrote:
    > >> >> >
    > >> >> >> Hi bigdaddy3
    > >> >> >>
    > >> >> >> With code
    > >> >> >>
    > >> >> >> On Error Resume Next
    > >> >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> >> On Error GoTo 0
    > >> >> >>
    > >> >> >> Mnual
    > >> >> >>
    > >> >> >> Select your data
    > >> >> >> F5
    > >> >> >> Special..Blanks
    > >> >> >> OK
    > >> >> >> Choose a color in the formatting toolbar
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >> >> --
    > >> >> >> Regards Ron de Bruin
    > >> >> >> http://www.rondebruin.nl
    > >> >> >>
    > >> >> >>
    > >> >> >> "bigdaddy3" <[email protected]> wrote in message
    > >> >> >> news:[email protected]...
    > >> >> >> >i would like to automatically color all blank cells unfilled which can vary
    > >> >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> >> >> > cells will be no more than 100
    > >> >> >> > --
    > >> >> >> > BD3
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  5. #5
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    When you use the code to protect you can use a password if you want

    Sh.Protect Password:="ron", userinterfaceonly:=True

    > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > columns a to p and then only down as far as row 100,also as far as the
    > protected sheet goes it unprotects to


    Can you explain more ?

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > columns a to p and then only down as far as row 100,also as far as the
    > protected sheet goes it unprotects to fill but i would like it protected
    > again when finished with the original password. any thoughts
    > --
    > BD3
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi
    >>
    >> Protect your sheets with code like this in the open event
    >>
    >> Private Sub Workbook_Open()
    >> Dim Sh As Worksheet
    >> Application.ScreenUpdating = False
    >> For Each Sh In ThisWorkbook.Worksheets
    >> Sh.Protect userinterfaceonly:=True
    >> Next
    >> Application.ScreenUpdating = True
    >> End Sub
    >>
    >>
    >> >and then when i do it even colors in some of my headings that
    >> > are part of an initial template ive created.

    >>
    >> You can adapt the range
    >> sh.UsedRange
    >>
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> > Hi ron, tried that but as the worksheet is protected it wont work unless i
    >> > unprotect it and then when i do it even colors in some of my headings that
    >> > are part of an initial template ive created.
    >> > --
    >> > BD3
    >> >
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> >> Hi BD3
    >> >>
    >> >> You can run it in a event in the thisworkbook module
    >> >>
    >> >> This event will run when you save your workbook
    >> >>
    >> >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    >> >> Dim sh As Worksheet
    >> >> For Each sh In ThisWorkbook.Worksheets
    >> >> On Error Resume Next
    >> >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> On Error GoTo 0
    >> >> Next sh
    >> >> End Sub
    >> >>
    >> >> See this page about events
    >> >> http://www.cpearson.com/excel/events.htm
    >> >>
    >> >>
    >> >> --
    >> >> Regards Ron de Bruin
    >> >> http://www.rondebruin.nl
    >> >>
    >> >>
    >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> >> > Hi ron, where would i insert that code.
    >> >> > --
    >> >> > BD3
    >> >> >
    >> >> >
    >> >> > "Ron de Bruin" wrote:
    >> >> >
    >> >> >> Hi bigdaddy3
    >> >> >>
    >> >> >> With code
    >> >> >>
    >> >> >> On Error Resume Next
    >> >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> >> On Error GoTo 0
    >> >> >>
    >> >> >> Mnual
    >> >> >>
    >> >> >> Select your data
    >> >> >> F5
    >> >> >> Special..Blanks
    >> >> >> OK
    >> >> >> Choose a color in the formatting toolbar
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >> --
    >> >> >> Regards Ron de Bruin
    >> >> >> http://www.rondebruin.nl
    >> >> >>
    >> >> >>
    >> >> >> "bigdaddy3" <[email protected]> wrote in message
    >> >> >> news:[email protected]...
    >> >> >> >i would like to automatically color all blank cells unfilled which can vary
    >> >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    >> >> >> > cells will be no more than 100
    >> >> >> > --
    >> >> >> > BD3
    >> >> >>
    >> >> >>
    >> >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  6. #6
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    columns a to p and then only down as far as row 100,also as far as the
    protected sheet goes it unprotects to fill but i would like it protected
    again when finished with the original password. any thoughts
    --
    BD3


    "Ron de Bruin" wrote:

    > Hi
    >
    > Protect your sheets with code like this in the open event
    >
    > Private Sub Workbook_Open()
    > Dim Sh As Worksheet
    > Application.ScreenUpdating = False
    > For Each Sh In ThisWorkbook.Worksheets
    > Sh.Protect userinterfaceonly:=True
    > Next
    > Application.ScreenUpdating = True
    > End Sub
    >
    >
    > >and then when i do it even colors in some of my headings that
    > > are part of an initial template ive created.

    >
    > You can adapt the range
    > sh.UsedRange
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > > unprotect it and then when i do it even colors in some of my headings that
    > > are part of an initial template ive created.
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi BD3
    > >>
    > >> You can run it in a event in the thisworkbook module
    > >>
    > >> This event will run when you save your workbook
    > >>
    > >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > >> Dim sh As Worksheet
    > >> For Each sh In ThisWorkbook.Worksheets
    > >> On Error Resume Next
    > >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> On Error GoTo 0
    > >> Next sh
    > >> End Sub
    > >>
    > >> See this page about events
    > >> http://www.cpearson.com/excel/events.htm
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> > Hi ron, where would i insert that code.
    > >> > --
    > >> > BD3
    > >> >
    > >> >
    > >> > "Ron de Bruin" wrote:
    > >> >
    > >> >> Hi bigdaddy3
    > >> >>
    > >> >> With code
    > >> >>
    > >> >> On Error Resume Next
    > >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> On Error GoTo 0
    > >> >>
    > >> >> Mnual
    > >> >>
    > >> >> Select your data
    > >> >> F5
    > >> >> Special..Blanks
    > >> >> OK
    > >> >> Choose a color in the formatting toolbar
    > >> >>
    > >> >>
    > >> >>
    > >> >> --
    > >> >> Regards Ron de Bruin
    > >> >> http://www.rondebruin.nl
    > >> >>
    > >> >>
    > >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >> >i would like to automatically color all blank cells unfilled which can vary
    > >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> >> > cells will be no more than 100
    > >> >> > --
    > >> >> > BD3
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  7. #7
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi thanks ron ill do that
    --
    BD3


    "Ron de Bruin" wrote:

    > Hi
    >
    > Protect your sheets with code like this in the open event
    >
    > Private Sub Workbook_Open()
    > Dim Sh As Worksheet
    > Application.ScreenUpdating = False
    > For Each Sh In ThisWorkbook.Worksheets
    > Sh.Protect userinterfaceonly:=True
    > Next
    > Application.ScreenUpdating = True
    > End Sub
    >
    >
    > >and then when i do it even colors in some of my headings that
    > > are part of an initial template ive created.

    >
    > You can adapt the range
    > sh.UsedRange
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > > unprotect it and then when i do it even colors in some of my headings that
    > > are part of an initial template ive created.
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi BD3
    > >>
    > >> You can run it in a event in the thisworkbook module
    > >>
    > >> This event will run when you save your workbook
    > >>
    > >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > >> Dim sh As Worksheet
    > >> For Each sh In ThisWorkbook.Worksheets
    > >> On Error Resume Next
    > >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> On Error GoTo 0
    > >> Next sh
    > >> End Sub
    > >>
    > >> See this page about events
    > >> http://www.cpearson.com/excel/events.htm
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> > Hi ron, where would i insert that code.
    > >> > --
    > >> > BD3
    > >> >
    > >> >
    > >> > "Ron de Bruin" wrote:
    > >> >
    > >> >> Hi bigdaddy3
    > >> >>
    > >> >> With code
    > >> >>
    > >> >> On Error Resume Next
    > >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> On Error GoTo 0
    > >> >>
    > >> >> Mnual
    > >> >>
    > >> >> Select your data
    > >> >> F5
    > >> >> Special..Blanks
    > >> >> OK
    > >> >> Choose a color in the formatting toolbar
    > >> >>
    > >> >>
    > >> >>
    > >> >> --
    > >> >> Regards Ron de Bruin
    > >> >> http://www.rondebruin.nl
    > >> >>
    > >> >>
    > >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >> >i would like to automatically color all blank cells unfilled which can vary
    > >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> >> > cells will be no more than 100
    > >> >> > --
    > >> >> > BD3
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  8. #8
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi

    Protect your sheets with code like this in the open event

    Private Sub Workbook_Open()
    Dim Sh As Worksheet
    Application.ScreenUpdating = False
    For Each Sh In ThisWorkbook.Worksheets
    Sh.Protect userinterfaceonly:=True
    Next
    Application.ScreenUpdating = True
    End Sub


    >and then when i do it even colors in some of my headings that
    > are part of an initial template ive created.


    You can adapt the range
    sh.UsedRange



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > unprotect it and then when i do it even colors in some of my headings that
    > are part of an initial template ive created.
    > --
    > BD3
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi BD3
    >>
    >> You can run it in a event in the thisworkbook module
    >>
    >> This event will run when you save your workbook
    >>
    >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    >> Dim sh As Worksheet
    >> For Each sh In ThisWorkbook.Worksheets
    >> On Error Resume Next
    >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> On Error GoTo 0
    >> Next sh
    >> End Sub
    >>
    >> See this page about events
    >> http://www.cpearson.com/excel/events.htm
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> > Hi ron, where would i insert that code.
    >> > --
    >> > BD3
    >> >
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> >> Hi bigdaddy3
    >> >>
    >> >> With code
    >> >>
    >> >> On Error Resume Next
    >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> On Error GoTo 0
    >> >>
    >> >> Mnual
    >> >>
    >> >> Select your data
    >> >> F5
    >> >> Special..Blanks
    >> >> OK
    >> >> Choose a color in the formatting toolbar
    >> >>
    >> >>
    >> >>
    >> >> --
    >> >> Regards Ron de Bruin
    >> >> http://www.rondebruin.nl
    >> >>
    >> >>
    >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> >> >i would like to automatically color all blank cells unfilled which can vary
    >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    >> >> > cells will be no more than 100
    >> >> > --
    >> >> > BD3
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  9. #9
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi ron, tried that but as the worksheet is protected it wont work unless i
    unprotect it and then when i do it even colors in some of my headings that
    are part of an initial template ive created.
    --
    BD3


    "Ron de Bruin" wrote:

    > Hi BD3
    >
    > You can run it in a event in the thisworkbook module
    >
    > This event will run when you save your workbook
    >
    > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > Dim sh As Worksheet
    > For Each sh In ThisWorkbook.Worksheets
    > On Error Resume Next
    > sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > On Error GoTo 0
    > Next sh
    > End Sub
    >
    > See this page about events
    > http://www.cpearson.com/excel/events.htm
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > Hi ron, where would i insert that code.
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi bigdaddy3
    > >>
    > >> With code
    > >>
    > >> On Error Resume Next
    > >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> On Error GoTo 0
    > >>
    > >> Mnual
    > >>
    > >> Select your data
    > >> F5
    > >> Special..Blanks
    > >> OK
    > >> Choose a color in the formatting toolbar
    > >>
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >i would like to automatically color all blank cells unfilled which can vary
    > >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> > cells will be no more than 100
    > >> > --
    > >> > BD3
    > >>
    > >>
    > >>

    >
    >
    >


  10. #10
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi BD3

    You can run it in a event in the thisworkbook module

    This event will run when you save your workbook

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Worksheets
    On Error Resume Next
    sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    On Error GoTo 0
    Next sh
    End Sub

    See this page about events
    http://www.cpearson.com/excel/events.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > Hi ron, where would i insert that code.
    > --
    > BD3
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi bigdaddy3
    >>
    >> With code
    >>
    >> On Error Resume Next
    >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> On Error GoTo 0
    >>
    >> Mnual
    >>
    >> Select your data
    >> F5
    >> Special..Blanks
    >> OK
    >> Choose a color in the formatting toolbar
    >>
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> >i would like to automatically color all blank cells unfilled which can vary
    >> > on each sheet at close of workbook,any suggestions .The total number of blank
    >> > cells will be no more than 100
    >> > --
    >> > BD3

    >>
    >>
    >>




  11. #11
    bigdaddy3
    Guest

    RE: Automatic coloring of blank cells when sheet work complete

    Hi Hayeso, i tried that but as the sheet and workbook are protected it brings
    up the dialog box "unable to set the color prop of interior class"
    --
    BD3


    "Hayeso" wrote:

    > Select Tools...Macro...Visual Basic Editor
    > Select View...Project Explorer (If Project Explorer not already visible)
    > Expand the VBAProject for your workbook and double click on the ThisWorkbook
    > icon
    >
    > Place the following code in the code window (RHS)
    > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > Dim aRange As Range, aCell As Range, aSheet As Worksheet
    > Dim aColour As Single
    > aColour = vbRed
    > For Each aSheet In ThisWorkbook.Sheets
    > Set aRange = aSheet.UsedRange
    > If aRange.Cells.Count > 1 Then
    > For Each aCell In aRange
    >
    > If aCell = "" Then
    > aCell.Interior.Color = aColour
    > End If
    > Next
    > End If
    > Next
    > End Sub
    >
    >
    > Select File...Close and return to Microsoft Excel
    >
    > Close the workbook and save when asked.
    >
    >
    > "bigdaddy3" wrote:
    >
    > > i would like to automatically color all blank cells unfilled which can vary
    > > on each sheet at close of workbook,any suggestions .The total number of blank
    > > cells will be no more than 100
    > > --
    > > BD3


  12. #12
    Hayeso
    Guest

    RE: Automatic coloring of blank cells when sheet work complete

    Select Tools...Macro...Visual Basic Editor
    Select View...Project Explorer (If Project Explorer not already visible)
    Expand the VBAProject for your workbook and double click on the ThisWorkbook
    icon

    Place the following code in the code window (RHS)
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Dim aRange As Range, aCell As Range, aSheet As Worksheet
    Dim aColour As Single
    aColour = vbRed
    For Each aSheet In ThisWorkbook.Sheets
    Set aRange = aSheet.UsedRange
    If aRange.Cells.Count > 1 Then
    For Each aCell In aRange

    If aCell = "" Then
    aCell.Interior.Color = aColour
    End If
    Next
    End If
    Next
    End Sub


    Select File...Close and return to Microsoft Excel

    Close the workbook and save when asked.


    "bigdaddy3" wrote:

    > i would like to automatically color all blank cells unfilled which can vary
    > on each sheet at close of workbook,any suggestions .The total number of blank
    > cells will be no more than 100
    > --
    > BD3


  13. #13
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi ron, where would i insert that code.
    --
    BD3


    "Ron de Bruin" wrote:

    > Hi bigdaddy3
    >
    > With code
    >
    > On Error Resume Next
    > ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > On Error GoTo 0
    >
    > Mnual
    >
    > Select your data
    > F5
    > Special..Blanks
    > OK
    > Choose a color in the formatting toolbar
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >i would like to automatically color all blank cells unfilled which can vary
    > > on each sheet at close of workbook,any suggestions .The total number of blank
    > > cells will be no more than 100
    > > --
    > > BD3

    >
    >
    >


  14. #14
    bigdaddy3
    Guest

    RE: Automatic coloring of blank cells when sheet work complete

    thanks i will try that
    --
    BD3


    "Hayeso" wrote:

    > Select Tools...Macro...Visual Basic Editor
    > Select View...Project Explorer (If Project Explorer not already visible)
    > Expand the VBAProject for your workbook and double click on the ThisWorkbook
    > icon
    >
    > Place the following code in the code window (RHS)
    > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > Dim aRange As Range, aCell As Range, aSheet As Worksheet
    > Dim aColour As Single
    > aColour = vbRed
    > For Each aSheet In ThisWorkbook.Sheets
    > Set aRange = aSheet.UsedRange
    > If aRange.Cells.Count > 1 Then
    > For Each aCell In aRange
    >
    > If aCell = "" Then
    > aCell.Interior.Color = aColour
    > End If
    > Next
    > End If
    > Next
    > End Sub
    >
    >
    > Select File...Close and return to Microsoft Excel
    >
    > Close the workbook and save when asked.
    >
    >
    > "bigdaddy3" wrote:
    >
    > > i would like to automatically color all blank cells unfilled which can vary
    > > on each sheet at close of workbook,any suggestions .The total number of blank
    > > cells will be no more than 100
    > > --
    > > BD3


  15. #15
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    columns a to p and then only down as far as row 100,also as far as the
    protected sheet goes it unprotects to fill but i would like it protected
    again when finished with the original password. any thoughts
    --
    BD3


    "Ron de Bruin" wrote:

    > Hi
    >
    > Protect your sheets with code like this in the open event
    >
    > Private Sub Workbook_Open()
    > Dim Sh As Worksheet
    > Application.ScreenUpdating = False
    > For Each Sh In ThisWorkbook.Worksheets
    > Sh.Protect userinterfaceonly:=True
    > Next
    > Application.ScreenUpdating = True
    > End Sub
    >
    >
    > >and then when i do it even colors in some of my headings that
    > > are part of an initial template ive created.

    >
    > You can adapt the range
    > sh.UsedRange
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > > unprotect it and then when i do it even colors in some of my headings that
    > > are part of an initial template ive created.
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi BD3
    > >>
    > >> You can run it in a event in the thisworkbook module
    > >>
    > >> This event will run when you save your workbook
    > >>
    > >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > >> Dim sh As Worksheet
    > >> For Each sh In ThisWorkbook.Worksheets
    > >> On Error Resume Next
    > >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> On Error GoTo 0
    > >> Next sh
    > >> End Sub
    > >>
    > >> See this page about events
    > >> http://www.cpearson.com/excel/events.htm
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> > Hi ron, where would i insert that code.
    > >> > --
    > >> > BD3
    > >> >
    > >> >
    > >> > "Ron de Bruin" wrote:
    > >> >
    > >> >> Hi bigdaddy3
    > >> >>
    > >> >> With code
    > >> >>
    > >> >> On Error Resume Next
    > >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> On Error GoTo 0
    > >> >>
    > >> >> Mnual
    > >> >>
    > >> >> Select your data
    > >> >> F5
    > >> >> Special..Blanks
    > >> >> OK
    > >> >> Choose a color in the formatting toolbar
    > >> >>
    > >> >>
    > >> >>
    > >> >> --
    > >> >> Regards Ron de Bruin
    > >> >> http://www.rondebruin.nl
    > >> >>
    > >> >>
    > >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >> >i would like to automatically color all blank cells unfilled which can vary
    > >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> >> > cells will be no more than 100
    > >> >> > --
    > >> >> > BD3
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  16. #16
    bigdaddy3
    Guest

    Automatic coloring of blank cells when sheet work complete

    i would like to automatically color all blank cells unfilled which can vary
    on each sheet at close of workbook,any suggestions .The total number of blank
    cells will be no more than 100
    --
    BD3

  17. #17
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Thanks ron that works a treat
    --
    BD3


    "Ron de Bruin" wrote:

    > You can use a range like this
    >
    > Range("A6:G100") instead of UsedRange
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > ron ,yes in those tot 5 rows is information ie company name,address etc and
    > > are already coloured and i dont want those affected as they are on a template
    > > and give me a new sheet to be filled in every time that is why i need to be
    > > able to color below that down to row say 100. Both the sheet and workbook are
    > > locked in excel leaving just a certain no of cells to be filled in but if
    > > they are not thats why i want to color just the unfilled ones which can be
    > > different every time, i hope this makes sense
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> When you use the code to protect you can use a password if you want
    > >>
    > >> Sh.Protect Password:="ron", userinterfaceonly:=True
    > >>
    > >> > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > >> > columns a to p and then only down as far as row 100,also as far as the
    > >> > protected sheet goes it unprotects to
    > >>
    > >> Can you explain more ?
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > >> > columns a to p and then only down as far as row 100,also as far as the
    > >> > protected sheet goes it unprotects to fill but i would like it protected
    > >> > again when finished with the original password. any thoughts
    > >> > --
    > >> > BD3
    > >> >
    > >> >
    > >> > "Ron de Bruin" wrote:
    > >> >
    > >> >> Hi
    > >> >>
    > >> >> Protect your sheets with code like this in the open event
    > >> >>
    > >> >> Private Sub Workbook_Open()
    > >> >> Dim Sh As Worksheet
    > >> >> Application.ScreenUpdating = False
    > >> >> For Each Sh In ThisWorkbook.Worksheets
    > >> >> Sh.Protect userinterfaceonly:=True
    > >> >> Next
    > >> >> Application.ScreenUpdating = True
    > >> >> End Sub
    > >> >>
    > >> >>
    > >> >> >and then when i do it even colors in some of my headings that
    > >> >> > are part of an initial template ive created.
    > >> >>
    > >> >> You can adapt the range
    > >> >> sh.UsedRange
    > >> >>
    > >> >>
    > >> >>
    > >> >> --
    > >> >> Regards Ron de Bruin
    > >> >> http://www.rondebruin.nl
    > >> >>
    > >> >>
    > >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >> > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > >> >> > unprotect it and then when i do it even colors in some of my headings that
    > >> >> > are part of an initial template ive created.
    > >> >> > --
    > >> >> > BD3
    > >> >> >
    > >> >> >
    > >> >> > "Ron de Bruin" wrote:
    > >> >> >
    > >> >> >> Hi BD3
    > >> >> >>
    > >> >> >> You can run it in a event in the thisworkbook module
    > >> >> >>
    > >> >> >> This event will run when you save your workbook
    > >> >> >>
    > >> >> >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > >> >> >> Dim sh As Worksheet
    > >> >> >> For Each sh In ThisWorkbook.Worksheets
    > >> >> >> On Error Resume Next
    > >> >> >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> >> On Error GoTo 0
    > >> >> >> Next sh
    > >> >> >> End Sub
    > >> >> >>
    > >> >> >> See this page about events
    > >> >> >> http://www.cpearson.com/excel/events.htm
    > >> >> >>
    > >> >> >>
    > >> >> >> --
    > >> >> >> Regards Ron de Bruin
    > >> >> >> http://www.rondebruin.nl
    > >> >> >>
    > >> >> >>
    > >> >> >> "bigdaddy3" <[email protected]> wrote in message
    > >> >> >> news:[email protected]...
    > >> >> >> > Hi ron, where would i insert that code.
    > >> >> >> > --
    > >> >> >> > BD3
    > >> >> >> >
    > >> >> >> >
    > >> >> >> > "Ron de Bruin" wrote:
    > >> >> >> >
    > >> >> >> >> Hi bigdaddy3
    > >> >> >> >>
    > >> >> >> >> With code
    > >> >> >> >>
    > >> >> >> >> On Error Resume Next
    > >> >> >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> >> >> On Error GoTo 0
    > >> >> >> >>
    > >> >> >> >> Mnual
    > >> >> >> >>
    > >> >> >> >> Select your data
    > >> >> >> >> F5
    > >> >> >> >> Special..Blanks
    > >> >> >> >> OK
    > >> >> >> >> Choose a color in the formatting toolbar
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >> --
    > >> >> >> >> Regards Ron de Bruin
    > >> >> >> >> http://www.rondebruin.nl
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >> "bigdaddy3" <[email protected]> wrote in message
    > >> >> >> >> news:[email protected]...
    > >> >> >> >> >i would like to automatically color all blank cells unfilled which can vary
    > >> >> >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> >> >> >> > cells will be no more than 100
    > >> >> >> >> > --
    > >> >> >> >> > BD3
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  18. #18
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    You can use a range like this

    Range("A6:G100") instead of UsedRange

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > ron ,yes in those tot 5 rows is information ie company name,address etc and
    > are already coloured and i dont want those affected as they are on a template
    > and give me a new sheet to be filled in every time that is why i need to be
    > able to color below that down to row say 100. Both the sheet and workbook are
    > locked in excel leaving just a certain no of cells to be filled in but if
    > they are not thats why i want to color just the unfilled ones which can be
    > different every time, i hope this makes sense
    > --
    > BD3
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> When you use the code to protect you can use a password if you want
    >>
    >> Sh.Protect Password:="ron", userinterfaceonly:=True
    >>
    >> > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    >> > columns a to p and then only down as far as row 100,also as far as the
    >> > protected sheet goes it unprotects to

    >>
    >> Can you explain more ?
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    >> > columns a to p and then only down as far as row 100,also as far as the
    >> > protected sheet goes it unprotects to fill but i would like it protected
    >> > again when finished with the original password. any thoughts
    >> > --
    >> > BD3
    >> >
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> >> Hi
    >> >>
    >> >> Protect your sheets with code like this in the open event
    >> >>
    >> >> Private Sub Workbook_Open()
    >> >> Dim Sh As Worksheet
    >> >> Application.ScreenUpdating = False
    >> >> For Each Sh In ThisWorkbook.Worksheets
    >> >> Sh.Protect userinterfaceonly:=True
    >> >> Next
    >> >> Application.ScreenUpdating = True
    >> >> End Sub
    >> >>
    >> >>
    >> >> >and then when i do it even colors in some of my headings that
    >> >> > are part of an initial template ive created.
    >> >>
    >> >> You can adapt the range
    >> >> sh.UsedRange
    >> >>
    >> >>
    >> >>
    >> >> --
    >> >> Regards Ron de Bruin
    >> >> http://www.rondebruin.nl
    >> >>
    >> >>
    >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> >> > Hi ron, tried that but as the worksheet is protected it wont work unless i
    >> >> > unprotect it and then when i do it even colors in some of my headings that
    >> >> > are part of an initial template ive created.
    >> >> > --
    >> >> > BD3
    >> >> >
    >> >> >
    >> >> > "Ron de Bruin" wrote:
    >> >> >
    >> >> >> Hi BD3
    >> >> >>
    >> >> >> You can run it in a event in the thisworkbook module
    >> >> >>
    >> >> >> This event will run when you save your workbook
    >> >> >>
    >> >> >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    >> >> >> Dim sh As Worksheet
    >> >> >> For Each sh In ThisWorkbook.Worksheets
    >> >> >> On Error Resume Next
    >> >> >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> >> On Error GoTo 0
    >> >> >> Next sh
    >> >> >> End Sub
    >> >> >>
    >> >> >> See this page about events
    >> >> >> http://www.cpearson.com/excel/events.htm
    >> >> >>
    >> >> >>
    >> >> >> --
    >> >> >> Regards Ron de Bruin
    >> >> >> http://www.rondebruin.nl
    >> >> >>
    >> >> >>
    >> >> >> "bigdaddy3" <[email protected]> wrote in message
    >> >> >> news:[email protected]...
    >> >> >> > Hi ron, where would i insert that code.
    >> >> >> > --
    >> >> >> > BD3
    >> >> >> >
    >> >> >> >
    >> >> >> > "Ron de Bruin" wrote:
    >> >> >> >
    >> >> >> >> Hi bigdaddy3
    >> >> >> >>
    >> >> >> >> With code
    >> >> >> >>
    >> >> >> >> On Error Resume Next
    >> >> >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> >> >> On Error GoTo 0
    >> >> >> >>
    >> >> >> >> Mnual
    >> >> >> >>
    >> >> >> >> Select your data
    >> >> >> >> F5
    >> >> >> >> Special..Blanks
    >> >> >> >> OK
    >> >> >> >> Choose a color in the formatting toolbar
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >> >> --
    >> >> >> >> Regards Ron de Bruin
    >> >> >> >> http://www.rondebruin.nl
    >> >> >> >>
    >> >> >> >>
    >> >> >> >> "bigdaddy3" <[email protected]> wrote in message
    >> >> >> >> news:[email protected]...
    >> >> >> >> >i would like to automatically color all blank cells unfilled which can vary
    >> >> >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    >> >> >> >> > cells will be no more than 100
    >> >> >> >> > --
    >> >> >> >> > BD3
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  19. #19
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi bigdaddy3

    With code

    On Error Resume Next
    ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    On Error GoTo 0

    Mnual

    Select your data
    F5
    Special..Blanks
    OK
    Choose a color in the formatting toolbar



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >i would like to automatically color all blank cells unfilled which can vary
    > on each sheet at close of workbook,any suggestions .The total number of blank
    > cells will be no more than 100
    > --
    > BD3




  20. #20
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    ron ,yes in those tot 5 rows is information ie company name,address etc and
    are already coloured and i dont want those affected as they are on a template
    and give me a new sheet to be filled in every time that is why i need to be
    able to color below that down to row say 100. Both the sheet and workbook are
    locked in excel leaving just a certain no of cells to be filled in but if
    they are not thats why i want to color just the unfilled ones which can be
    different every time, i hope this makes sense
    --
    BD3


    "Ron de Bruin" wrote:

    > When you use the code to protect you can use a password if you want
    >
    > Sh.Protect Password:="ron", userinterfaceonly:=True
    >
    > > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > > columns a to p and then only down as far as row 100,also as far as the
    > > protected sheet goes it unprotects to

    >
    > Can you explain more ?
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > > columns a to p and then only down as far as row 100,also as far as the
    > > protected sheet goes it unprotects to fill but i would like it protected
    > > again when finished with the original password. any thoughts
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi
    > >>
    > >> Protect your sheets with code like this in the open event
    > >>
    > >> Private Sub Workbook_Open()
    > >> Dim Sh As Worksheet
    > >> Application.ScreenUpdating = False
    > >> For Each Sh In ThisWorkbook.Worksheets
    > >> Sh.Protect userinterfaceonly:=True
    > >> Next
    > >> Application.ScreenUpdating = True
    > >> End Sub
    > >>
    > >>
    > >> >and then when i do it even colors in some of my headings that
    > >> > are part of an initial template ive created.
    > >>
    > >> You can adapt the range
    > >> sh.UsedRange
    > >>
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > >> > unprotect it and then when i do it even colors in some of my headings that
    > >> > are part of an initial template ive created.
    > >> > --
    > >> > BD3
    > >> >
    > >> >
    > >> > "Ron de Bruin" wrote:
    > >> >
    > >> >> Hi BD3
    > >> >>
    > >> >> You can run it in a event in the thisworkbook module
    > >> >>
    > >> >> This event will run when you save your workbook
    > >> >>
    > >> >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > >> >> Dim sh As Worksheet
    > >> >> For Each sh In ThisWorkbook.Worksheets
    > >> >> On Error Resume Next
    > >> >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> On Error GoTo 0
    > >> >> Next sh
    > >> >> End Sub
    > >> >>
    > >> >> See this page about events
    > >> >> http://www.cpearson.com/excel/events.htm
    > >> >>
    > >> >>
    > >> >> --
    > >> >> Regards Ron de Bruin
    > >> >> http://www.rondebruin.nl
    > >> >>
    > >> >>
    > >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >> > Hi ron, where would i insert that code.
    > >> >> > --
    > >> >> > BD3
    > >> >> >
    > >> >> >
    > >> >> > "Ron de Bruin" wrote:
    > >> >> >
    > >> >> >> Hi bigdaddy3
    > >> >> >>
    > >> >> >> With code
    > >> >> >>
    > >> >> >> On Error Resume Next
    > >> >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> >> On Error GoTo 0
    > >> >> >>
    > >> >> >> Mnual
    > >> >> >>
    > >> >> >> Select your data
    > >> >> >> F5
    > >> >> >> Special..Blanks
    > >> >> >> OK
    > >> >> >> Choose a color in the formatting toolbar
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >> >> --
    > >> >> >> Regards Ron de Bruin
    > >> >> >> http://www.rondebruin.nl
    > >> >> >>
    > >> >> >>
    > >> >> >> "bigdaddy3" <[email protected]> wrote in message
    > >> >> >> news:[email protected]...
    > >> >> >> >i would like to automatically color all blank cells unfilled which can vary
    > >> >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> >> >> > cells will be no more than 100
    > >> >> >> > --
    > >> >> >> > BD3
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  21. #21
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    When you use the code to protect you can use a password if you want

    Sh.Protect Password:="ron", userinterfaceonly:=True

    > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > columns a to p and then only down as far as row 100,also as far as the
    > protected sheet goes it unprotects to


    Can you explain more ?

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > Hi Ron have done that okay but i would like to stop it coloring rows 1to 5 in
    > columns a to p and then only down as far as row 100,also as far as the
    > protected sheet goes it unprotects to fill but i would like it protected
    > again when finished with the original password. any thoughts
    > --
    > BD3
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi
    >>
    >> Protect your sheets with code like this in the open event
    >>
    >> Private Sub Workbook_Open()
    >> Dim Sh As Worksheet
    >> Application.ScreenUpdating = False
    >> For Each Sh In ThisWorkbook.Worksheets
    >> Sh.Protect userinterfaceonly:=True
    >> Next
    >> Application.ScreenUpdating = True
    >> End Sub
    >>
    >>
    >> >and then when i do it even colors in some of my headings that
    >> > are part of an initial template ive created.

    >>
    >> You can adapt the range
    >> sh.UsedRange
    >>
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> > Hi ron, tried that but as the worksheet is protected it wont work unless i
    >> > unprotect it and then when i do it even colors in some of my headings that
    >> > are part of an initial template ive created.
    >> > --
    >> > BD3
    >> >
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> >> Hi BD3
    >> >>
    >> >> You can run it in a event in the thisworkbook module
    >> >>
    >> >> This event will run when you save your workbook
    >> >>
    >> >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    >> >> Dim sh As Worksheet
    >> >> For Each sh In ThisWorkbook.Worksheets
    >> >> On Error Resume Next
    >> >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> On Error GoTo 0
    >> >> Next sh
    >> >> End Sub
    >> >>
    >> >> See this page about events
    >> >> http://www.cpearson.com/excel/events.htm
    >> >>
    >> >>
    >> >> --
    >> >> Regards Ron de Bruin
    >> >> http://www.rondebruin.nl
    >> >>
    >> >>
    >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> >> > Hi ron, where would i insert that code.
    >> >> > --
    >> >> > BD3
    >> >> >
    >> >> >
    >> >> > "Ron de Bruin" wrote:
    >> >> >
    >> >> >> Hi bigdaddy3
    >> >> >>
    >> >> >> With code
    >> >> >>
    >> >> >> On Error Resume Next
    >> >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> >> On Error GoTo 0
    >> >> >>
    >> >> >> Mnual
    >> >> >>
    >> >> >> Select your data
    >> >> >> F5
    >> >> >> Special..Blanks
    >> >> >> OK
    >> >> >> Choose a color in the formatting toolbar
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >> --
    >> >> >> Regards Ron de Bruin
    >> >> >> http://www.rondebruin.nl
    >> >> >>
    >> >> >>
    >> >> >> "bigdaddy3" <[email protected]> wrote in message
    >> >> >> news:[email protected]...
    >> >> >> >i would like to automatically color all blank cells unfilled which can vary
    >> >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    >> >> >> > cells will be no more than 100
    >> >> >> > --
    >> >> >> > BD3
    >> >> >>
    >> >> >>
    >> >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  22. #22
    Hayeso
    Guest

    RE: Automatic coloring of blank cells when sheet work complete

    Select Tools...Macro...Visual Basic Editor
    Select View...Project Explorer (If Project Explorer not already visible)
    Expand the VBAProject for your workbook and double click on the ThisWorkbook
    icon

    Place the following code in the code window (RHS)
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Dim aRange As Range, aCell As Range, aSheet As Worksheet
    Dim aColour As Single
    aColour = vbRed
    For Each aSheet In ThisWorkbook.Sheets
    Set aRange = aSheet.UsedRange
    If aRange.Cells.Count > 1 Then
    For Each aCell In aRange

    If aCell = "" Then
    aCell.Interior.Color = aColour
    End If
    Next
    End If
    Next
    End Sub


    Select File...Close and return to Microsoft Excel

    Close the workbook and save when asked.


    "bigdaddy3" wrote:

    > i would like to automatically color all blank cells unfilled which can vary
    > on each sheet at close of workbook,any suggestions .The total number of blank
    > cells will be no more than 100
    > --
    > BD3


  23. #23
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi thanks ron ill do that
    --
    BD3


    "Ron de Bruin" wrote:

    > Hi
    >
    > Protect your sheets with code like this in the open event
    >
    > Private Sub Workbook_Open()
    > Dim Sh As Worksheet
    > Application.ScreenUpdating = False
    > For Each Sh In ThisWorkbook.Worksheets
    > Sh.Protect userinterfaceonly:=True
    > Next
    > Application.ScreenUpdating = True
    > End Sub
    >
    >
    > >and then when i do it even colors in some of my headings that
    > > are part of an initial template ive created.

    >
    > You can adapt the range
    > sh.UsedRange
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > > unprotect it and then when i do it even colors in some of my headings that
    > > are part of an initial template ive created.
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi BD3
    > >>
    > >> You can run it in a event in the thisworkbook module
    > >>
    > >> This event will run when you save your workbook
    > >>
    > >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > >> Dim sh As Worksheet
    > >> For Each sh In ThisWorkbook.Worksheets
    > >> On Error Resume Next
    > >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> On Error GoTo 0
    > >> Next sh
    > >> End Sub
    > >>
    > >> See this page about events
    > >> http://www.cpearson.com/excel/events.htm
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> > Hi ron, where would i insert that code.
    > >> > --
    > >> > BD3
    > >> >
    > >> >
    > >> > "Ron de Bruin" wrote:
    > >> >
    > >> >> Hi bigdaddy3
    > >> >>
    > >> >> With code
    > >> >>
    > >> >> On Error Resume Next
    > >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> >> On Error GoTo 0
    > >> >>
    > >> >> Mnual
    > >> >>
    > >> >> Select your data
    > >> >> F5
    > >> >> Special..Blanks
    > >> >> OK
    > >> >> Choose a color in the formatting toolbar
    > >> >>
    > >> >>
    > >> >>
    > >> >> --
    > >> >> Regards Ron de Bruin
    > >> >> http://www.rondebruin.nl
    > >> >>
    > >> >>
    > >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >> >i would like to automatically color all blank cells unfilled which can vary
    > >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> >> > cells will be no more than 100
    > >> >> > --
    > >> >> > BD3
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


  24. #24
    bigdaddy3
    Guest

    RE: Automatic coloring of blank cells when sheet work complete

    thanks i will try that
    --
    BD3


    "Hayeso" wrote:

    > Select Tools...Macro...Visual Basic Editor
    > Select View...Project Explorer (If Project Explorer not already visible)
    > Expand the VBAProject for your workbook and double click on the ThisWorkbook
    > icon
    >
    > Place the following code in the code window (RHS)
    > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > Dim aRange As Range, aCell As Range, aSheet As Worksheet
    > Dim aColour As Single
    > aColour = vbRed
    > For Each aSheet In ThisWorkbook.Sheets
    > Set aRange = aSheet.UsedRange
    > If aRange.Cells.Count > 1 Then
    > For Each aCell In aRange
    >
    > If aCell = "" Then
    > aCell.Interior.Color = aColour
    > End If
    > Next
    > End If
    > Next
    > End Sub
    >
    >
    > Select File...Close and return to Microsoft Excel
    >
    > Close the workbook and save when asked.
    >
    >
    > "bigdaddy3" wrote:
    >
    > > i would like to automatically color all blank cells unfilled which can vary
    > > on each sheet at close of workbook,any suggestions .The total number of blank
    > > cells will be no more than 100
    > > --
    > > BD3


  25. #25
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi

    Protect your sheets with code like this in the open event

    Private Sub Workbook_Open()
    Dim Sh As Worksheet
    Application.ScreenUpdating = False
    For Each Sh In ThisWorkbook.Worksheets
    Sh.Protect userinterfaceonly:=True
    Next
    Application.ScreenUpdating = True
    End Sub


    >and then when i do it even colors in some of my headings that
    > are part of an initial template ive created.


    You can adapt the range
    sh.UsedRange



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > Hi ron, tried that but as the worksheet is protected it wont work unless i
    > unprotect it and then when i do it even colors in some of my headings that
    > are part of an initial template ive created.
    > --
    > BD3
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi BD3
    >>
    >> You can run it in a event in the thisworkbook module
    >>
    >> This event will run when you save your workbook
    >>
    >> Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    >> Dim sh As Worksheet
    >> For Each sh In ThisWorkbook.Worksheets
    >> On Error Resume Next
    >> sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> On Error GoTo 0
    >> Next sh
    >> End Sub
    >>
    >> See this page about events
    >> http://www.cpearson.com/excel/events.htm
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> > Hi ron, where would i insert that code.
    >> > --
    >> > BD3
    >> >
    >> >
    >> > "Ron de Bruin" wrote:
    >> >
    >> >> Hi bigdaddy3
    >> >>
    >> >> With code
    >> >>
    >> >> On Error Resume Next
    >> >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> >> On Error GoTo 0
    >> >>
    >> >> Mnual
    >> >>
    >> >> Select your data
    >> >> F5
    >> >> Special..Blanks
    >> >> OK
    >> >> Choose a color in the formatting toolbar
    >> >>
    >> >>
    >> >>
    >> >> --
    >> >> Regards Ron de Bruin
    >> >> http://www.rondebruin.nl
    >> >>
    >> >>
    >> >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> >> >i would like to automatically color all blank cells unfilled which can vary
    >> >> > on each sheet at close of workbook,any suggestions .The total number of blank
    >> >> > cells will be no more than 100
    >> >> > --
    >> >> > BD3
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  26. #26
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi ron, tried that but as the worksheet is protected it wont work unless i
    unprotect it and then when i do it even colors in some of my headings that
    are part of an initial template ive created.
    --
    BD3


    "Ron de Bruin" wrote:

    > Hi BD3
    >
    > You can run it in a event in the thisworkbook module
    >
    > This event will run when you save your workbook
    >
    > Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    > Dim sh As Worksheet
    > For Each sh In ThisWorkbook.Worksheets
    > On Error Resume Next
    > sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > On Error GoTo 0
    > Next sh
    > End Sub
    >
    > See this page about events
    > http://www.cpearson.com/excel/events.htm
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > > Hi ron, where would i insert that code.
    > > --
    > > BD3
    > >
    > >
    > > "Ron de Bruin" wrote:
    > >
    > >> Hi bigdaddy3
    > >>
    > >> With code
    > >>
    > >> On Error Resume Next
    > >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > >> On Error GoTo 0
    > >>
    > >> Mnual
    > >>
    > >> Select your data
    > >> F5
    > >> Special..Blanks
    > >> OK
    > >> Choose a color in the formatting toolbar
    > >>
    > >>
    > >>
    > >> --
    > >> Regards Ron de Bruin
    > >> http://www.rondebruin.nl
    > >>
    > >>
    > >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >> >i would like to automatically color all blank cells unfilled which can vary
    > >> > on each sheet at close of workbook,any suggestions .The total number of blank
    > >> > cells will be no more than 100
    > >> > --
    > >> > BD3
    > >>
    > >>
    > >>

    >
    >
    >


  27. #27
    bigdaddy3
    Guest

    RE: Automatic coloring of blank cells when sheet work complete

    Hi Hayeso, i tried that but as the sheet and workbook are protected it brings
    up the dialog box "unable to set the color prop of interior class"
    --
    BD3


    "Hayeso" wrote:

    > Select Tools...Macro...Visual Basic Editor
    > Select View...Project Explorer (If Project Explorer not already visible)
    > Expand the VBAProject for your workbook and double click on the ThisWorkbook
    > icon
    >
    > Place the following code in the code window (RHS)
    > Private Sub Workbook_BeforeClose(Cancel As Boolean)
    > Dim aRange As Range, aCell As Range, aSheet As Worksheet
    > Dim aColour As Single
    > aColour = vbRed
    > For Each aSheet In ThisWorkbook.Sheets
    > Set aRange = aSheet.UsedRange
    > If aRange.Cells.Count > 1 Then
    > For Each aCell In aRange
    >
    > If aCell = "" Then
    > aCell.Interior.Color = aColour
    > End If
    > Next
    > End If
    > Next
    > End Sub
    >
    >
    > Select File...Close and return to Microsoft Excel
    >
    > Close the workbook and save when asked.
    >
    >
    > "bigdaddy3" wrote:
    >
    > > i would like to automatically color all blank cells unfilled which can vary
    > > on each sheet at close of workbook,any suggestions .The total number of blank
    > > cells will be no more than 100
    > > --
    > > BD3


  28. #28
    Ron de Bruin
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi BD3

    You can run it in a event in the thisworkbook module

    This event will run when you save your workbook

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Worksheets
    On Error Resume Next
    sh.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    On Error GoTo 0
    Next sh
    End Sub

    See this page about events
    http://www.cpearson.com/excel/events.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > Hi ron, where would i insert that code.
    > --
    > BD3
    >
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi bigdaddy3
    >>
    >> With code
    >>
    >> On Error Resume Next
    >> ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    >> On Error GoTo 0
    >>
    >> Mnual
    >>
    >> Select your data
    >> F5
    >> Special..Blanks
    >> OK
    >> Choose a color in the formatting toolbar
    >>
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >> "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    >> >i would like to automatically color all blank cells unfilled which can vary
    >> > on each sheet at close of workbook,any suggestions .The total number of blank
    >> > cells will be no more than 100
    >> > --
    >> > BD3

    >>
    >>
    >>




  29. #29
    bigdaddy3
    Guest

    Re: Automatic coloring of blank cells when sheet work complete

    Hi ron, where would i insert that code.
    --
    BD3


    "Ron de Bruin" wrote:

    > Hi bigdaddy3
    >
    > With code
    >
    > On Error Resume Next
    > ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks).Interior.ColorIndex = 3
    > On Error GoTo 0
    >
    > Mnual
    >
    > Select your data
    > F5
    > Special..Blanks
    > OK
    > Choose a color in the formatting toolbar
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "bigdaddy3" <[email protected]> wrote in message news:[email protected]...
    > >i would like to automatically color all blank cells unfilled which can vary
    > > on each sheet at close of workbook,any suggestions .The total number of blank
    > > cells will be no more than 100
    > > --
    > > BD3

    >
    >
    >


+ 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