View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Marie Marie is offline
external usenet poster
 
Posts: 143
Default Fill Series of Disjointed Selection across Rows & Columns?

When I run NumberCells, the first cell starts at 303 for some odd reason.
The next is 304, then 305, 306, 307 ...

How might I fix this?

Also, how could I modify the code to skip all cells with the letter "a" as a
value?

Thank you.

"Bernie Deitrick" wrote:

Marie,

Select one of the shaded cells, and run this sub:

Sub test()
MsgBox ActiveCell.Interior.ColorIndex
End Sub

Remeber that number.

Then select all the cells that could be filled in (including the colored cells), and run this sub,
after putting the number from the last sub where the XXXX is:

Sub NumberCells()
Dim myC As Range
For Each myC In Selection
If (Not myC.MergeCells) And myC.Interior.ColorIndex < XXXX Then
myC.Value = Application.Max(myC.Offset(-1, 0).EntireRow, _
Cells(myC.Row, 1).Resize(1, myC.Column - 1)) + 1
End If
Next myC
End Sub

HTH,
Bernie
MS Excel MVP


"Marie" wrote in message
...
How can I quickly finish numbering the white boxes in this spread sheet?

http://i34.tinypic.com/33y6pgm.jpg

Thank you very much.