ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   HIghlight cells (https://www.excelbanter.com/excel-programming/362788-highlight-cells.html)

Jim

HIghlight cells
 
I have an excell spreadsheet, where I enter numbers in colum A and B. In col
H, I, and J are totals, subtotals, etc. My question is, if I enter a
number in Col A row 18, How can I get Row 18 Col H, I and J to be highlighted.

Row Col A Col B Col H Col I

18 8 8 256 I would like Col H and I
to be highlighted.

Ardus Petus

HIghlight cells
 
Paste following code in your worksheet's code
(right-click worksheet tab, select View Code)

HTH
--
AP

'-----------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("A")) Is Nothing Or _
Target.Count 1 Then Exit Sub
Cells(Target.Row, "H").Resize(1, 3).Select
End Sub
'---------------------------------------------

"Jim" a écrit dans le message de news:
...
I have an excell spreadsheet, where I enter numbers in colum A and B. In
col
H, I, and J are totals, subtotals, etc. My question is, if I enter a
number in Col A row 18, How can I get Row 18 Col H, I and J to be
highlighted.

Row Col A Col B Col H Col I

18 8 8 256 I would like Col H and
I
to be highlighted.




Tom Ogilvy

HIghlight cells
 
right click on the sheet tab and select View Code

At the top of the module,
in the left dropdown select Worksheet and in the right dropdown select Change

Make the resulting procedure look like this:

Private Sub Worksheet_Change(ByVal Target As Range)
if target.count 1 then exit sub
if target.column = 1 then
Range("A,H:J").Interior.colorIndex = xlNone
Target.Range("A1,H1:J1").Interior.ColorIndex = 36
end if
End Sub

It is unclear when you want it to loose its highlighting. Not that this can
possibly clear the undo history.

--
Regards,
Tom Ogilvy


"Jim" wrote:

I have an excell spreadsheet, where I enter numbers in colum A and B. In col
H, I, and J are totals, subtotals, etc. My question is, if I enter a
number in Col A row 18, How can I get Row 18 Col H, I and J to be highlighted.

Row Col A Col B Col H Col I

18 8 8 256 I would like Col H and I
to be highlighted.



All times are GMT +1. The time now is 06:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com