[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

Excel - macro error

Asked by ping_it in Microsoft Excel Spreadsheet Software, Spreadsheet Software, Probability & Statistics

I am using a macro to search from the current sheet "column A" of the current document for the same results appearing in the sheet called "item list" of the report.xls.

The macro starts fine, then I make CRTL-BREAK, and check the debug... and it highlights this:

If rng2.Address <> FirstAddress Then

when I try to resume the macro it says:

saying that: object variable or with block variable not set


Please tell me how to correct this, so that the macro will continue

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
Sub HightEm()
    Dim wb1 As Workbook, wb2 As Workbook
    Dim ws1 As Worksheet, ws2 As Worksheet
    Dim rng1 As Range, c As Range, rng2 As Range
    Dim FirstAddress As String
    Application.ScreenUpdating = False
    Set wb1 = ThisWorkbook
    Set wb2 = Workbooks("report.xls")
    Set ws1 = wb1.Sheets("Validation")
    Set rng1 = ws1.Range(ws1.[a1], ws1.Cells(Rows.Count, "A").End(xlUp))
    Set ws2 = wb2.Worksheets("Item List")
    For Each c In rng1
        For Each ws2 In wb2.Worksheets
            FirstAddress = vbNullString
            Set rng2 = Nothing
            Set rng2 = ws2.Cells.Find(c.Value, [a1], xlValues, , , xlPrevious, xlWhole)
            If Not rng2 Is Nothing Then
                FirstAddress = rng2.Address
                ws1.Cells(c.Row, "D") = rng2.Parent.Name & " " & rng2.Address(0, 0)
                Do
                    Set rng2 = ws2.Cells.FindNext(rng2)
                    If rng2.Address <> FirstAddress Then ws1.Cells(c.Row, "D") = ws1.Cells(c.Row, "D").Value & vbCrLf & rng2.Parent.Name & " " & rng2.Address(0, 0)
                Loop While Not rng2 Is Nothing And rng2.Address <> FirstAddress
            End If
        Next ws2
    Next c
    Application.ScreenUpdating = True
End Sub
[+][-]11/03/09 05:42 AM, ID: 25728797Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11/03/09 05:50 AM, ID: 25728854Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/03/09 05:57 AM, ID: 25728926Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/03/09 06:00 AM, ID: 25728964Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/03/09 06:01 AM, ID: 25728972Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/03/09 06:02 AM, ID: 25728975Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/03/09 06:07 AM, ID: 25729025Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/03/09 06:09 AM, ID: 25729041Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Microsoft Excel Spreadsheet Software, Spreadsheet Software, Probability & Statistics
Sign Up Now!
Solution Provided By: brettdj
Participating Experts: 3
Solution Grade: A
 
[+][-]11/03/09 06:09 AM, ID: 25729042Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/03/09 06:13 AM, ID: 25729086Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/03/09 08:41 PM, ID: 25736447Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_Related_20080208