Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hello,
I just started messing around with VBA and I got something approaching what I want (what I want is to highlight a row based on a value in the 1st column). This is highlighting the wrong row though! It looks like all the numbers are correct... for instance, when I step through it, I'll get the correct row selected but a different row highlighted! Please shed some light on this! It's quite frustrating. ' first column has dates from 12/2003 to 12/2006 Private Sub Worksheet_Activate() Const Yellow = 6 Dim row As String Range("A1").Select Do While ActiveCell.Value < "" Selection.EntireRow.Interior.ColorIndex = xlColorIndexNone If Month(ActiveCell.Value) = Month(Now) And _ Year(ActiveCell.Value) = Year(Now) Then row = "A" & CStr(ActiveCell.row) & _ ":L" & CStr(ActiveCell.row) 'MsgBox (row) Selection.Range(row).Interior.ColorIndex = Yellow Exit Sub End If ActiveCell.Offset(1, 0).Select Loop End Sub Thanks, Andrew |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problems with Excel 2003 after downloading Office SP1 | Excel Discussion (Misc queries) | |||
Dynamic charting problems (events) | Charts and Charting in Excel | |||
I am having problems creating pivot table of data | Charts and Charting in Excel | |||
Exel Problems! | Excel Discussion (Misc queries) | |||
Problems pasting images into Excel | Excel Discussion (Misc queries) |