LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Moving rows with grey background color to bottom (2003)

Hey!
I've gotten a request from a user to program a VB macro that moves all rows
in a spreadsheet to the bottom if it contains a color (rgb(120,120,120))
I've been google'ing like nuts, but I've yet to find a solution that fits
the task.

As I've set it up right now its basicly something like this:

' Do a quick loop to find the bottom:
Do
iCounter = iCounter + 1
Loop Untill Cells(iCounter, 1).Value = ""

' Copy bottom interget into correct variable
iBottom = iCounter

' Set iCounter to first row below header.
iCounter = 2

Pseudocode for what I need:
loop while iCounter < iBottom
if currentRow.BackgroundColor = Grey
swap currentRow with Row(iBottom)
iBottom - 1
else iCounter + 1
end if
loop end

Can anyone help me out?
--
Cato Larsen
HelpDesk Monkey
 
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 2003 Font Color and Background Color DrankPA6 Excel Discussion (Misc queries) 1 August 12th 05 11:43 PM
Grey Background message Thrava Excel Discussion (Misc queries) 2 February 22nd 05 01:06 AM
Deletion of rows according to background color salim Excel Programming 3 June 19th 04 01:27 PM
Identify rows with certain background color? DonLi Excel Programming 4 January 23rd 04 10:38 PM
Background color for 50,000 odd-numbered rows lothario[_42_] Excel Programming 4 November 2nd 03 05:39 AM


All times are GMT +1. The time now is 03:46 AM.

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"