So, after much searching the wonderful web, I still can find a solution. I am trying to create an Excel VBS Script that does multiple functions. I have some of it working (yay me), but now I need some help.
First part of it needs to find data in a specific column, that is greater than a number value and less than a subsequent number value. Once it identifies this it needs to move the rows within this range to a different worksheet. This what I have so far and it keeps hanging on the <> area...
Dim i, LastRow
LastRow = Sheets("RAW DATA_AD All Users Report").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Inactive Users").Range("A2:S7500").ClearContents
For i = 2 To LastRow
If Sheets("RAW DATA_AD All Users Report").Cells(i, "L").Value = ">30 & <90" Then
Sheets("RAW DATA_AD All Users Report").Cells(i, "L").EntireRow.Copy Destination:=Sheets("Inactive Users").Range("A" & Rows.Count).End(xlUp).Offset(1)
LastRow = Sheets("RAW DATA_AD All Users Report").Range("A" & Rows.Count).End(xlUp).Row
End If
Next i
End Sub
The other part is an IF AND function. I need to it find in a column the IF condition of "FALSE" followed by an AND IF a second column has a >= to a number value. Once it identifies this it needs to move the rows to a different worksheet.
Dim i, LastRow
LastRow = Sheets("RAW DATA_AD All Users Report").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Password Mangement").Range("A2:S7500").ClearContents
For i = 2 To LastRow
If Sheets("RAW DATA_AD All Users Report").Cells(i, "E").Value = "FALSE" And Sheets("RAW DATA_AD All Users Report").Cells(i, "L").Value = ">= 90" Then
Sheets("RAW DATA_AD All Users Report").Cells(i, "K").EntireRow.Copy Destination:=Sheets("Password Mangement").Range("A" & Rows.Count).End(xlUp).Offset(1)
LastRow = Sheets("RAW DATA_AD All Users Report").Range("A" & Rows.Count).End(xlUp).Row
End If
Next i
End Sub
First part of it needs to find data in a specific column, that is greater than a number value and less than a subsequent number value. Once it identifies this it needs to move the rows within this range to a different worksheet. This what I have so far and it keeps hanging on the <> area...
Dim i, LastRow
LastRow = Sheets("RAW DATA_AD All Users Report").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Inactive Users").Range("A2:S7500").ClearContents
For i = 2 To LastRow
If Sheets("RAW DATA_AD All Users Report").Cells(i, "L").Value = ">30 & <90" Then
Sheets("RAW DATA_AD All Users Report").Cells(i, "L").EntireRow.Copy Destination:=Sheets("Inactive Users").Range("A" & Rows.Count).End(xlUp).Offset(1)
LastRow = Sheets("RAW DATA_AD All Users Report").Range("A" & Rows.Count).End(xlUp).Row
End If
Next i
End Sub
The other part is an IF AND function. I need to it find in a column the IF condition of "FALSE" followed by an AND IF a second column has a >= to a number value. Once it identifies this it needs to move the rows to a different worksheet.
Dim i, LastRow
LastRow = Sheets("RAW DATA_AD All Users Report").Range("A" & Rows.Count).End(xlUp).Row
Sheets("Password Mangement").Range("A2:S7500").ClearContents
For i = 2 To LastRow
If Sheets("RAW DATA_AD All Users Report").Cells(i, "E").Value = "FALSE" And Sheets("RAW DATA_AD All Users Report").Cells(i, "L").Value = ">= 90" Then
Sheets("RAW DATA_AD All Users Report").Cells(i, "K").EntireRow.Copy Destination:=Sheets("Password Mangement").Range("A" & Rows.Count).End(xlUp).Offset(1)
LastRow = Sheets("RAW DATA_AD All Users Report").Range("A" & Rows.Count).End(xlUp).Row
End If
Next i
End Sub