Advertisement

10.11.2008 at 02:47PM PDT, ID: 23806979
[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!

8.8

Program is only outputting one cell of a row, need to output entire row...

Asked by guacolizard in Visual Basic Programming

Tags:

I need to figure out how to output the entire row of the matched cell. The program works it only outputs the exact matched cell. The problem is I also need the info in the cells to the left and right of the same row in the output file. Please, if possible provide an explanation so I can see what was missing. I still trying to learn. Thanks in advance.Start Free Trial
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:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
Private Sub Exit_Click()
Me.Hide
End Sub
 
Private Sub Open_Click()
 
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim strPath As String, strFile1 As String, strFile2 As String
Dim wbkThis As Workbook, wbk1 As Workbook, wbk2 As Workbook
Dim wksDest As Worksheet, wksSource As Worksheet, wksCheck As Worksheet
Dim rngMatch As Range, rngCheck As Range, rngFound As Range, rngCopy As Range
 
  CommonDialog1.flags = cdlOFNExplorer Or cdlOFNLongNames
  CommonDialog1.FileName = ""
  CommonDialog1.Filter = "Excel Files (*.xls)|*.xls|"
  CommonDialog1.DialogTitle = "Browse for file"
  CommonDialog1.ShowOpen
 
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open(CommonDialog1.FileName)
 
    Set wbkThis = Workbooks.Add
    Set wbk1 = xlBook
    Set wbk2 = Excel.Workbooks.Open("c:\Users\User1.xls")
   
    'Change sheet names as required
   
    ' This is the sheet to copy to
    Set wksDest = wbkThis.Sheets("Sheet1")
    ' This is the sheet in XLS1
    Set wksSource = wbk1.Sheets(1)
    Set wksCheck = wbk2.Sheets(1)
     
 
    ' Get first blank row in main workbook to copy to
    With wksDest
        Set rngCopy = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
    End With
    ' First cell to check in XLS1
    Set rngMatch = wksSource.Range("D1")
    ' Set check range to all used cells in column A of XLS2
    With wksCheck
        Set rngCheck = wksCheck.Range("a2")
        'Set rngCheck = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
    End With
    ' Loop through cells in column A of XLS1 until a blank cell is encountered
    Do Until Len(rngMatch.value) = 0
        Set rngFound = rngCheck.Find(what:=rngMatch.value, LookIn:=xlValues, lookat:=xlWhole)
        If Not rngFound Is Nothing Then
            ' Copy data from XLS2 to this workbook
            rngFound.Copy rngCopy
            Set rngCopy = rngCopy.Offset(1, 0)
        End If
        Set rngMatch = rngMatch.Offset(1, 0)
    Loop
    wbk1.Close False
    wbk2.Close False
    wbkThis.Save
End Sub
Attachments:
 
This the file to open to search and compare with user1.xls
 
 
compare against file
 
[+][-]10.11.2008 at 08:12PM PDT, ID: 22696113

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.11.2008 at 10:59PM PDT, ID: 22696477

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.11.2008 at 11:48PM PDT, ID: 22696562

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2008 at 09:15AM PDT, ID: 22697905

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2008 at 12:04PM PDT, ID: 22698484

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2008 at 02:15PM PDT, ID: 22698899

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 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.12.2008 at 02:28PM PDT, ID: 22698935

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 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.12.2008 at 02:58PM PDT, ID: 22699049

View this solution now by starting your 7-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

Zone: Visual Basic Programming
Tags: Visual Basic 6
Sign Up Now!
Solution Provided By: irudyk
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628