Highlight blank cells

  • Thread starter Thread starter Rhonda
  • Start date Start date
R

Rhonda

Hi,

I was wondering if there is a macro that can highlight
blank cells in the range B9:G31, maybe a color, to
identify to the user that information is required to be
entered into that cell. Or any method that would seem
appropriate?

One other question, I have a feeling this is not possible
but anyway, here goes, is it possible to create a routine
for a command button that would prompt the user to enter
a query name(achieved when you right click on a query and
then open Data Range Properties, this is the actual name
of the iqy file)and when the user enters the name, he can
then delete it from it's place on the spreadsheet(in my
case it would be somewhere in sheet 2) and the iqy file
stored in the Microsoft/Queries default folder? Maybe you
know another way of handling it. Either way, I would be
truly grateful!!!! Thanks for your help!
 
Rhonda

will this do:

Range("B9:G31").SpecialCells(xlCellTypeBlanks).Select

Regards

Trevor
 
Hi Trevor,

I placed the line of code in the This Workbook, Open
procedure but it doesn't work!! Maybe I'm wrong with
doing that, I am not up on Excel programming!!!

Please advise.

Thanks,

Rhonda
 
Rhonda

you could put it an event, for example:

Private Sub Worksheet_Activate()
Range("B9:G31").SpecialCells(xlCellTypeBlanks).Select
End Sub

This code could go in the sheet where the range of cells are. Select
another sheet and then go back to the original.

Or you could just have a subroutine in a general module and run it when
required (perhaps attached to a button)

Sub HighlightBlanks()
Range("B9:G31").SpecialCells(xlCellTypeBlanks).Select
End Sub

As Tom has pointed out, you could do this with conditional formatting.

Regards

Trevor
 
Back
Top