Hey All! I'm new to excel vba and I'm attempting to generate a report from downloaded data. The data usually includes some extra columns that are unnecessary along with rows if a certain box is marked "x". I'm attempting to copy all columns with certain headers but exclude those rows that have an "x" in a specific column. Below is what I have so far.
My Goal is to exclude rows where column B row "x" has a "X" in the box. Any help would be greatly appreciated!
Code:
Private Sub Run_Click()
Dim wsO As Worksheet
Dim wsF As Worksheet
Dim i As Integer
Application.ScreenUpdating = False
Set wsO = Worksheets("Data")
Set wsF = Worksheets("Output")
myColumns = Array("A", "C", "E", "F", "G", "J")
With wsO.Range("A1:W1")
For i = 0 To UBound(myColumns)
On Error Resume Next
.Find(myColumns(i)).EntireColumn.Copy Destination:=wsF.Cells(1, i + 1)
Err.Clear
Next i
End With
Set wsO = Nothing
Set wsF = Nothing
Application.ScreenUpdating = True
End Sub
My Goal is to exclude rows where column B row "x" has a "X" in the box. Any help would be greatly appreciated!