Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Findind values in a worksheet and fornatting them


Hi all,

I need a bit of VB code to run off of a button which when clicked wil
check a list of values (say in the range J2:J30) and format any othe
cells on the worksheet to say bold blue text and italic that match th
range mentioned before.

Can anyone help with this

--
chrisrowe_c
-----------------------------------------------------------------------
chrisrowe_cr's Profile: http://www.excelforum.com/member.php...fo&userid=2522
View this thread: http://www.excelforum.com/showthread.php?threadid=39099

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Findind values in a worksheet and fornatting them

Look at the sample code provided with the FindNext method of the range
object (in Excel VBA help). It should be easily adaptable to your
requirement.

--
Regards,
Tom Ogilvy

"chrisrowe_cr"
wrote in message
news:chrisrowe_cr.1sw0en_1122566780.8384@excelforu m-nospam.com...

Hi all,

I need a bit of VB code to run off of a button which when clicked will
check a list of values (say in the range J2:J30) and format any other
cells on the worksheet to say bold blue text and italic that match the
range mentioned before.

Can anyone help with this?


--
chrisrowe_cr
------------------------------------------------------------------------
chrisrowe_cr's Profile:

http://www.excelforum.com/member.php...o&userid=25220
View this thread: http://www.excelforum.com/showthread...hreadid=390996



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Findind values in a worksheet and fornatting them


Here is a modified version of the find next code Tom is referring to.
Give it a try


Code
-------------------
Sub FormatFoundValues()
Dim entry As Range, foundentry As Range, firstaddress As String
For Each entry In Range("J2:J30")
Set foundentry = Cells.find(what:=entry.Value)
If Not foundentry Is Nothing Then
firstaddress = foundentry.Address
Do
With foundentry.Font
.ColorIndex = 5
.Bold = True
.Italic = True
End With
Set foundentry = Cells.FindNext(After:=foundentry)
Loop While Not foundentry Is Nothing And foundentry.Address < firstaddress
End If
Next entry
End Su
-------------------


HT

--
bhofset
-----------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...fo&userid=1880
View this thread: http://www.excelforum.com/showthread.php?threadid=39099

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
delete value on worksheet 2 that match values on worksheet 1 np Excel Discussion (Misc queries) 0 December 10th 09 06:02 PM
Deleting a worksheet but retaining values from the worksheet. [email protected] Excel Discussion (Misc queries) 1 September 13th 06 03:00 PM
Deleting a worksheet but retaining values from the worksheet. [email protected] Excel Discussion (Misc queries) 1 September 13th 06 02:48 PM
excel 97: copy and paste values from one worksheet to another worksheet JMCN Excel Programming 2 September 23rd 03 01:32 PM
excel 97: copy and paste values from one worksheet to another worksheet Kathy[_5_] Excel Programming 0 September 21st 03 03:03 PM


All times are GMT +1. The time now is 05:46 PM.

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"