Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
delete value on worksheet 2 that match values on worksheet 1 | Excel Discussion (Misc queries) | |||
Deleting a worksheet but retaining values from the worksheet. | Excel Discussion (Misc queries) | |||
Deleting a worksheet but retaining values from the worksheet. | Excel Discussion (Misc queries) | |||
excel 97: copy and paste values from one worksheet to another worksheet | Excel Programming | |||
excel 97: copy and paste values from one worksheet to another worksheet | Excel Programming |