JasonWilliam
New Member
- Joined
- May 11, 2021
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
I have a excel sheet that I need help with and I'm sure it is an easy code. I want to add to my code that I already have a section where if the value in the "P" column is "Yes" then it returns a "Sent" value in the "AA" column of the same row. Any help with this would be greatly appreciated.
This is my code I have right now. I know this is probably an easy add on, but my brain is fried right now and I'm drawing a blank.
Private Sub CommandButton2_Click()
Dim WB As Workbook
Dim WS As Worksheet
Dim AC As String: AC = Sheets("OPS").Range("E1").Value
Dim BC As String: BC = Sheets("OPS").Range("E2").Value
Dim RevValue As Variant
ResetButton CommandButton2
Application.Workbooks.Add xlWBATWorksheet
Set WB = ActiveWorkbook
Set WS = ActiveSheet
With ThisWorkbook.Worksheets("OPS")
.Range("A3:Q1000").Copy
WS.Range("A3").PasteSpecial xlPasteValues
End With
WS.Range("P2").Value = "FilterCol"
WS.Columns.AutoFilter field:=16, Criteria1:="<>Yes", Criteria2:="<>user_str_3"
WS.UsedRange.SpecialCells(xlCellTypeVisible).EntireRow.Delete
WS.AutoFilterMode = False
WB.SaveAs Filename:="G:\Laser\ORDERS\ORDER_" & AC & "-" & BC & "_REV.csv", FileFormat:=xlCSV
WB.Close False
FileCopy "G:\Laser\ORDERS\ORDER_" & AC & "-" & BC & "_REV.csv", _
"G:\Laser\ORDERS\ORDER_" & AC & "-" & BC & "_REV.syn"
Range("P4:P1000").ClearContents
End Sub