troubleshooting Question

how do i displaying all rows which column "Q" minus column "II" > 0 in Macro Excel 2007 VB?

Avatar of gvilbis
gvilbis asked on
Microsoft ExcelVB Script
1 Comment1 Solution307 ViewsLast Modified:
i have the following code and i would like to add condition to display the rows that column "Q" minus Column "II" > 0:

Set wbResult = Workbooks.Open(Filename:=ThisWorkbook.Path & "\Master Book.xlsm", Password:="White1022", ReadOnly:=True)
    RowInd = 2
    For i = 2 To Workbooks(wbResult.Name).Worksheets("Sheet1").Range("A2").CurrentRegion.Rows.Count
        If Workbooks(wbResult.Name).Worksheets("Sheet1").Range("AN" & i) <> "" Then
            Workbooks(wbResult.Name).Worksheets("Sheet1").Range(Cells(i, 1), Cells(i, 106)).Copy ThisWorkbook.Worksheets("Sheet1").Range("A" & RowInd)
                ThisWorkbook.Worksheets("Sheet1").Range("A" & RowInd) = i
            RowInd = RowInd + 1
        End If
    Next i
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros