View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default steping through all cells

Hi Lars,

Perhaps try:

'=============
Public Sub Tester()
Dim SH As Worksheet
Dim rng As Range
Dim rw As Range
Dim rCell As Range

Set SH = ActiveSheet '<<==== CHANGE

On Error Resume Next
Set rng = SH.Cells.SpecialCells(xlCellTypeConstants)
On Error GoTo 0

If Not rng Is Nothing Then
For Each rw In rng.Rows
For Each rCell In rw.Cells
With rCell
MsgBox .Value & vbTab & .Address
End With
Next
Next
End If
End Sub
'<<=============


---
Regards,
Norman


"Lars" wrote in message
...
Norman,

For Each cell In Row.Cells worked fine, thanks :-)

But now all cells are shown, not just the ones that have values into them.

How may I select just the ones that have a value ? Thanks!