Macros


Posted by Brad on January 31, 2002 6:11 AM

I have a macro that takes inforamtion from One master sheet and copies the information into other sheet. All this happens in the same workbook. My question is how do I get the macro to highlight what inforamtion it copied off the master sheet. That way I can tell if any information was not copied or missed. included is a copy of the macro

Public Sub CopyRows()
Sheets("Master Report").Select
' Find the last row of data
FinalRow = Range("A65536").End(xlUp).Row
' Loop through each row
For x = 2 To FinalRow
' Decide if to copy based on column D
ThisValue = Range("D" & x).Value
ElseIf ThisValue = "Brownstown PC" Then
Range("A" & x & ":E" & x).Copy
Sheets("Brown").Select
NextRow = Range("A65536").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste
Sheets("Master Report").Select

End If
Next x
End Sub

Thanks for the help

Brad

Posted by Jacob on January 31, 2002 6:16 AM

Hi

Add this right after the lines that will copy the text

Range("A" & x & ":E" & x).select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With

This will color all the copied cells light yellow.

HTH

Jacob



Posted by JohnG on January 31, 2002 6:17 AM