Prev Previous Post   Next Post Next
  #1   Report Post  
Andrew Clark
 
Posts: n/a
Default VBA problems

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
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
Problems with Excel 2003 after downloading Office SP1 Kristy Excel Discussion (Misc queries) 0 February 22nd 05 06:13 PM
Dynamic charting problems (events) [email protected] Charts and Charting in Excel 4 January 27th 05 09:32 PM
I am having problems creating pivot table of data wyman Charts and Charting in Excel 1 January 12th 05 05:17 PM
Exel Problems! PW11111 Excel Discussion (Misc queries) 2 December 9th 04 11:34 PM
Problems pasting images into Excel Wazooli Excel Discussion (Misc queries) 2 December 7th 04 11:33 PM


All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"