Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Fill Series of Disjointed Selection across Rows & Columns?

How can I quickly finish numbering the white boxes in this spread sheet?

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

Thank you very much.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Fill Series of Disjointed Selection across Rows & Columns?

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.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.




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

Ah, I just realized that there was data above that section and that's why it
started at 303. But it'd still be a big help if I could skip cells valued
with "a" .

Thanks again.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 143
Default Fill Series of Disjointed Selection across Rows & Columns?

I think the code fails if the color value is negative, i.e. -4142, because of
syntax. How can I properly enter this value?


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Fill Series of Disjointed Selection across Rows & Columns?

Marie,

This fills in cells with the colorindex of -4142....


Sub NumberCells2()
Dim myC As Range
For Each myC In Selection
If (Not myC.MergeCells) And _
(myC.Interior.ColorIndex = -4142) And _
(myC.Value < "a") 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
...
I think the code fails if the color value is negative, i.e. -4142, because of
syntax. How can I properly enter this value?



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
Excel 2007 texture fill of chart data series columns Leland Charts and Charting in Excel 11 October 8th 09 05:40 PM
fill series of multiple rows and columns jas Excel Discussion (Misc queries) 4 July 30th 08 03:50 AM
Fill Series Dates: not letting me change the series from year to m Mike Excel Discussion (Misc queries) 1 January 24th 08 05:08 PM
auto fill columns based on a selection ckane Excel Discussion (Misc queries) 1 May 4th 07 05:34 AM
Charts switch from 'Series in Rows' to 'Series in Columns' Peace Charts and Charting in Excel 4 March 22nd 07 03:52 AM


All times are GMT +1. The time now is 12:14 PM.

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

About Us

"It's about Microsoft Excel"