Highlight Entire Row based on single cell value

upcea

New Member
Joined
Mar 14, 2011
Messages
20
HELP! I have a huge spreadsheet that i need to select a bunch of rows. the rows i need to highlight are contingent on data in a single cell in column AA. How do I do this?

Once I highlight the rows, I would like to copy and paste in another sheet and maintain the blank rows that were not highlighted...make sense?

THANKS! and happy monday :/
 
what is happening is the rows I want to be copied to the new sheet are being cut from the origional sheet. the new sheet is a copy and paste of the whole doc- not just the rows i want.
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
what is happening is the rows I want to be copied to the new sheet are being cut from the origional sheet. the new sheet is a copy and paste of the whole doc- not just the rows i want.
 
Upvote 0
That doesn't happen for me. What should be in column AA to cause the row to be copied?
 
Upvote 0
For me this only copies the rows where column AA value is I

Code:
Sub CopyRows()
Dim c As Range, r As Range
For Each c In Columns("AA").SpecialCells(xlCellTypeConstants)
    If c.Value = "I" Then
        If r Is Nothing Then
            Set r = c
        Else
            Set r = Union(r, c)
        End If
    End If
    c.EntireRow.Copy Destination:=Sheets("Sheet2").Range("A" & c.Row)
Next c
If Not r Is Nothing Then r.EntireRow.Delete
End Sub
 
Upvote 0
blahhh still not working! must be something on my end. thanks for all of your help though. im going to fiddle with it and hopefully figure this out. thanks again!
 
Upvote 0
just thought of something- what if I wanted to just SELECT certain rows with cells in column "AA" containing "I" and then clear contents in the selected rows, could i do that?
 
Upvote 0
Try

Code:
Sub ClearRows()
Dim c As Range
For Each c In Columns("AA").SpecialCells(xlCellTypeConstants, xlTextValues)
    If c.Value = "I" Then c.EntireRow.ClearContents
Next c
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top