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: 1
Default Find() and Replace() in Excel 2007 not working.

Hi,

My program needs to find any white text in an Excel Worksheet andset it's
color to black. This is done prior to a automated printout, in order to make
sure the white text shows up in the print out.

This has worked fine until just recently. The code I've been using is (VB6):

Dim oSheet as Object

oSheet.Application.FindFormat.Clear
oSheet.Application.FindFormat.Font.ColorIndex = 2

oSheet.Application.ReplaceFormat.Clear
oSheet.Application.ReplaceFormat.Font.ColorIndex = 1

oSheet.Cells.Replace What:="", Replacement:="", SearchFormat:=True,
ReplaceFormat:=False



In a simple example, make an Excel file with one cell that has black text,
and one cell with white text. It should find the white text, and change it's
color to black.

I upgraded Office to 2007 from 2003. Under 2003 everything worked as
expected. Under 2007, everything works fine with 2003 documents (xls), but
NOT with 2007 documents (xlsx). The documents are identical, for all intents
and purposes, and I am able to find the text using the same technique via the
UI. I have inspected the cell and the cell has ColorIndex of 2, and should be
found, ut it is not.

Using Range.Find() or Range.Replace() with SearchFormat set to True, never
finds this cell, even though it should.

Can anyone explain why that is? Is there a difference in 2007 that effects
searching by format?

Thanks,
Troy

 
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 find/replace Nadine Excel Discussion (Misc queries) 0 June 18th 09 07:04 PM
find and replace Excel 2007 Lynne Excel Worksheet Functions 12 April 2nd 09 11:55 PM
Excel 2002: Why Find and Replace not working? Mr. Low Excel Discussion (Misc queries) 6 January 6th 09 03:37 PM
Find & Replace in Excel 2007 RM Excel Discussion (Misc queries) 3 July 3rd 08 12:20 AM
My Find and Replace function in Excel is not working? BPeach Excel Worksheet Functions 2 December 20th 06 11:27 PM


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