Re: Colour code the data range after data is filtered and pasted from another sheet
Hey cytop,
Thanks for your prompt reply!
I think I might need to expand on that a bit since this won't be direct define of colour.
Here are the codes I've used in the sheet.
Code
Sub Test()'
' Test
Dim lr As Long
Dim ws As Worksheet
Set ws = Sheets("display")
lr = ws.Cells(Rows.Count, "c").End(xlUp).Row
Application.ScreenUpdating = False
Sheets("Data source").Select
If ActiveSheet.AutoFilterMode Then Cells.AutoFilter
ActiveSheet.Range("$A$1:$S$102").AutoFilter Field:=5, Criteria1:="<>"
Range("A2:d102,e2:e102").Select
Selection.Copy
Sheets("Display").Select
Range("c" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'copy and paste the title of the course
Sheets("Data source").Select
Range("e1").Select
Selection.Copy
Sheets("Display").Select
Range("c" & Rows.Count).End(xlUp).Offset(-1, -2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.ScreenUpdating = True
End Sub
Display More
I'm trying to come up with a way to auto color the cells whenever a new set of data is pulled out of the data sheet. This is for purely visual differentiation. Since the position of the pulled data varies, I'm wondering if there is a way/code to auto color the range of cells that were active? (this range varies automatically)