Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to copy rows using fontcolor as bookmark?

Hi
I've got a workbook with 12 sheets, containing both old an new data.
The old data is in red font, the new in blue.
A sheet could contain maybe 200 - 300 rows with red font, and 0 -
maybe 20 in blue.

Is it possible to make a macro, that would copy/collect all the blue
rows in all 12 sheets into an emty sheet, leaveing the copied rows
red, in the original sheets?

Best regards
Henrik Bonde

Btw. Don't hit the emailreplybutton.
My header replyaddress don't work
Reply to group :-)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default How to copy rows using fontcolor as bookmark?

Henrik,

These assumption must be true about the data:

1. Sheet1 has no data and is the sheet that will collect the blue data
rows.
2. The entire row of blue data in each sheet is colored blue and the row
starts in column A of each sheet.
3. there are no blanks in your blue data rows.


Code could use some polishing, but it works:

Sub test()
Dim rng As Range
For Each sht In Sheets
Set rng = Nothing
If sht.Name < "Sheet1" Then
sht.Select
ActiveSheet.UsedRange.Select
For Each cell In Selection
If (cell.Font.ColorIndex = 5) Then
If rng Is Nothing Then
Set rng = cell
Else
Set rng = Union(rng, cell)
End If
End If
Next cell
If Not rng Is Nothing Then
rng.Select
End If
rng.EntireRow.Copy
Worksheets("Sheet1").Select
Range("A1").Select
If ActiveCell.End(xlDown).Row = Rows.Count Then ActiveCell.Select: GoTo
10
ActiveCell.End(xlDown).Offset(1, 0).Select
10 ActiveSheet.Paste
Else
End If
Next sht
End Sub

If you want a sample of the code in a file, e-mail me.
Don Pistulka




"Henrik Bonde (3400)" wrote in message
...
Hi
I've got a workbook with 12 sheets, containing both old an new data.
The old data is in red font, the new in blue.
A sheet could contain maybe 200 - 300 rows with red font, and 0 -
maybe 20 in blue.

Is it possible to make a macro, that would copy/collect all the blue
rows in all 12 sheets into an emty sheet, leaveing the copied rows
red, in the original sheets?

Best regards
Henrik Bonde

Btw. Don't hit the emailreplybutton.
My header replyaddress don't work
Reply to group :-)



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
VBA sort range with certain fontcolor Jack Sons[_2_] Excel Discussion (Misc queries) 5 June 3rd 10 11:32 PM
keyboard shortcut for fontcolor change in excel2002 version? gulam Excel Discussion (Misc queries) 2 November 9th 08 10:31 PM
Sum the values of cells based on fontcolor [email protected] Excel Worksheet Functions 1 March 28th 08 02:51 PM
bookmark or hyperlink? swissforestry Excel Discussion (Misc queries) 2 February 22nd 06 06:18 PM
Hyperlink to a bookmark erik Links and Linking in Excel 1 February 1st 05 12:25 AM


All times are GMT +1. The time now is 10:28 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"