Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Highlighting only cells with data in them

In an Excel Spreadsheet, I wish to highlight all the rows and columns
which contain data, however these change every time I access the File.

Is there any way I can highlight ONLY those rows and columns which
contain data?

Any ideas?

Many thanks.

Ian M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Highlighting only cells with data in them

Ian,

This isn't exactly what you've asked for, but I'm not certain exactly what
you've asked for.

If the data is contiguous (touching), select a cell that isn't empty, Edit -
Go to - Special - Used range.

I suspect anything else will require a macro.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Ian M" wrote in message
om...
In an Excel Spreadsheet, I wish to highlight all the rows and columns
which contain data, however these change every time I access the File.

Is there any way I can highlight ONLY those rows and columns which
contain data?

Any ideas?

Many thanks.

Ian M



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Highlighting only cells with data in them

Hi Ian,

In your worksheet module (right-click your sheet tab | view code),try
pasting the following code:

Private Sub Worksheet_Change(ByVal Target As Range)

Dim cell As Range
Dim Rng

Set Rng = Nothing

Application.ScreenUpdating = False

Cells.Interior.ColorIndex = xlNone

With Me.UsedRange
If Application.CountA(.Cells) = 0 Then Exit Sub

On Error Resume Next
If Not .SpecialCells(xlCellTypeConstants, 23) Is Nothing Then
Set Rng = .SpecialCells(xlCellTypeConstants, 23)
On Error GoTo 0
End If

On Error Resume Next
If Not .SpecialCells(xlCellTypeFormulas, 23) Is Nothing Then
If Not Rng Is Nothing Then
Set Rng = Union(Rng, .SpecialCells(xlCellTypeFormulas, 23))
On Error GoTo 0
Else
Set Rng = .SpecialCells(xlCellTypeFormulas, 23)
End If
End If

End With

For Each cell In Rng
With cell.EntireRow.Interior
.ColorIndex = 6 '<--------------- Amend to suit
.Pattern = xlSolid
End With
With cell.EntireColumn.Interior
.ColorIndex = 6 '<--------------- Amend to suit
.Pattern = xlSolid
End With
Next cell

Application.ScreenUpdating = True

End Sub

---
Regards,
Norman


"Ian M" wrote in message
om...
In an Excel Spreadsheet, I wish to highlight all the rows and columns
which contain data, however these change every time I access the File.

Is there any way I can highlight ONLY those rows and columns which
contain data?

Any ideas?

Many thanks.

Ian M



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlighting cells being updated/new data being inputted. Faraz A. Qureshi Excel Discussion (Misc queries) 2 September 8th 09 07:08 AM
finding data entry required cells by highlighting. gtslabs Excel Discussion (Misc queries) 6 October 12th 07 10:41 PM
Highlighting Cells comotoman Excel Discussion (Misc queries) 2 September 26th 05 03:45 PM
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. Jamie Furlong Excel Discussion (Misc queries) 6 August 28th 05 09:27 PM
Highlighting only cells with data in them Ian M Excel Programming 1 April 23rd 04 11:31 AM


All times are GMT +1. The time now is 08:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"