T
tarns
Hi Guys
I wanna be able to filter my set of data and then copy the autofilte
data to a new sheet and only apply formatting to those rows tha
contain data. My function copies the data correctly but i dont know ho
to pass the "RangeOfFilteredData" value into the subroutine, AND whic
function to use to select a row range when i know the column range i
always 8, but the row range is always differing, eg the variabl
"RangeOfFilteredData"
Code
-------------------
sub blah()
Sheets("List").Select 'Contains the data
Selection.AutoFilter Field:=9, Criteria1:="<>N/A" ' filtered data in sheet
Set NewOustandingRC = ActiveSheet.AutoFilter.Range ' copy fitered data
NewOustandingRC.Copy
RangeOfFilteredData = ActiveSheet.AutoFilter.Range
Sheets("Outstanding Issues").Select 'Paste data here
Range("A2").Select
Range("A2").PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Formatting(RangeOfFilteredData) ' <-Run Formatting Function
'UnFilter List in first sheet
Sheets("List").Select ' LIST
Selection.AutoFilter Field:=9
End Sub
Sub Formatting(Range As Integer)
Range("A2:I??????").Select <- I know the range
Selection.Interior.ColorIndex = 37
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2)=1"
Selection.FormatConditions(1).Interior.ColorIndex = 36
End Sub
I wanna be able to filter my set of data and then copy the autofilte
data to a new sheet and only apply formatting to those rows tha
contain data. My function copies the data correctly but i dont know ho
to pass the "RangeOfFilteredData" value into the subroutine, AND whic
function to use to select a row range when i know the column range i
always 8, but the row range is always differing, eg the variabl
"RangeOfFilteredData"
Code
-------------------
sub blah()
Sheets("List").Select 'Contains the data
Selection.AutoFilter Field:=9, Criteria1:="<>N/A" ' filtered data in sheet
Set NewOustandingRC = ActiveSheet.AutoFilter.Range ' copy fitered data
NewOustandingRC.Copy
RangeOfFilteredData = ActiveSheet.AutoFilter.Range
Sheets("Outstanding Issues").Select 'Paste data here
Range("A2").Select
Range("A2").PasteSpecial Paste:=xlPasteValuesAndNumberFormats
Formatting(RangeOfFilteredData) ' <-Run Formatting Function
'UnFilter List in first sheet
Sheets("List").Select ' LIST
Selection.AutoFilter Field:=9
End Sub
Sub Formatting(Range As Integer)
Range("A2:I??????").Select <- I know the range
Selection.Interior.ColorIndex = 37
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2)=1"
Selection.FormatConditions(1).Interior.ColorIndex = 36
End Sub