boomzboombam
New Member
- Joined
- Oct 7, 2014
- Messages
- 2
I've been taking a course on VBA and understand it when he explains it but I've been struggling on my own.
I just got a job that has me going through huge data sets and I want to be able to highlight data in 2 rows for the first and last name.
So far here's the data that I have that will run it, but it won't highlight it like i want.
If anyone has any recommendations I'd be very thankful!!!
Thanks guys!!!

"
Option Explicit
Sub selectrow()
Dim row_nUMBEr As Double
Dim first_NAMe As Range
Dim LASt_naME As Range
Dim rowRange As Range
row_nUMBEr = 1
Do
DoEvents
row_nUMBEr = row_nUMBEr + 1
Set first_NAMe = Range("B" & row_nUMBEr)
Set LASt_naME = Range("C" & row_nUMBEr)
If first_NAMe = "ANTHONY" & LASt_naME = "Brooks" Then
Set rowRange = Application.Range(first_NAMe).EntireRow.Select
rowRange.Cells.Interior.Color = vbRed
End If
Loop Until first_NAMe = ""
MsgBox "Completed"
End Sub
"
I just got a job that has me going through huge data sets and I want to be able to highlight data in 2 rows for the first and last name.
So far here's the data that I have that will run it, but it won't highlight it like i want.
If anyone has any recommendations I'd be very thankful!!!
Thanks guys!!!

"
Option Explicit
Sub selectrow()
Dim row_nUMBEr As Double
Dim first_NAMe As Range
Dim LASt_naME As Range
Dim rowRange As Range
row_nUMBEr = 1
Do
DoEvents
row_nUMBEr = row_nUMBEr + 1
Set first_NAMe = Range("B" & row_nUMBEr)
Set LASt_naME = Range("C" & row_nUMBEr)
If first_NAMe = "ANTHONY" & LASt_naME = "Brooks" Then
Set rowRange = Application.Range(first_NAMe).EntireRow.Select
rowRange.Cells.Interior.Color = vbRed
End If
Loop Until first_NAMe = ""
MsgBox "Completed"
End Sub
"