Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
MY BAD!!! There was another Grand Total in the report that was in White and
I couldn't see it! (For what it's worth, I didn't create the report, just trying to help auto format it.) It works. Thank you very much for your help! "Karin" wrote: $T$3 FYI: Grand Total is in A13 (should always be in A) "Jim Thomlinson" wrote: Try this and let me know what address pops up in the message box... Public Sub FormatTotal() Dim wks As Worksheet Dim rngFound As Range Set wks = ActiveSheet Set rngFound = wks.Cells.Find(What:="Grand Total", _ LookAt:=xlWhole, _ LookIn:=xlFormulas, _ MatchCase:=True) If rngFound Is Nothing Then MsgBox "Grand Total Not Found" Else With wks msgbox rngfound.address .Range(.Range("K3"), .Cells(rngFound.Row, "K")).Interior.ColorIndex = 15 End With End If End Sub -- HTH... Jim Thomlinson "Karin" wrote: It is only coloring cell K3 "Jim Thomlinson" wrote: Public Sub FormatTotal() Dim wks As Worksheet Dim rngFound As Range Set wks = ActiveSheet Set rngFound = wks.Cells.Find(What:="Grand Total", _ LookAt:=xlWhole, _ LookIn:=xlFormulas, _ MatchCase:=True) If rngFound Is Nothing Then MsgBox "Grand Total Not Found" Else With wks .Range(.Range("K3"), .Cells(rngFound.Row, "K")).Interior.ColorIndex = 15 End With End If End Sub -- HTH... Jim Thomlinson "Karin" wrote: Hi, (Excel 2003) I'm writing a macro to format a report. I want to Find "Grand Total" and then move over to column K, highlight up to K3 (absolute) and fill with gray. How do I do that? Thank you. (FYI: The length of the report will change, and Ctrl End actually goes past the end of the report.) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deselect B1 & move curser to select A1 | Excel Discussion (Misc queries) | |||
Select & Move Range | Excel Discussion (Misc queries) | |||
Macro to select cells without a certain value and select a menu it | Excel Worksheet Functions | |||
How do I select all the even rows in a worksheet and move them. | Excel Discussion (Misc queries) | |||
Move select data to another worksheet | Excel Discussion (Misc queries) |