Advertisement

03.27.2007 at 09:50AM PDT, ID: 22475445
[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!

6.4

Need a Genius:  Find, copy, paste rows based on more than one criteria!

Asked by josepharichard in Visual Basic v1.0.5.x, Microsoft Excel Spreadsheet Software, VB Script

This is what I have for a process to enter a date into Cell "G3" of sheet "Status Report" and, using that date, search the other sheets in the workbook for that date in column A of the other sheets and copy the entire row into a sheet, "Hidden Data."  The process also takes into consideration if one of the sheets does not have the required date, at which time a row is skipped where that row would go (if the sheet did have the date) on the "Hidden Data" sheet (Thanks to WJReid for that much necessary change).  The change I need now is to somehow account for if a sheet has more than one entry for a specific date.  There is a second column, column "B" that holds the time for the entry, and what I need in this process is that when searching through the sheet for the date, if the process encounters a sheet with more than one of the same date, the row with the most recent time is the one that is copied and pasted to the "Hidden Data" sheet.

The purpose of this sheet, if background information helps is to track the system statuses of certain pieces of equipment.  Each piece has its own sheet.  On the Status Report sheet a user enters a date and they can quickly, very colorfully organized, view the system statuses of the entered date, thus the "hidden data" sheet which acquires all the information for the date entered so that the Status Report sheet can draw the information from there to enter them into the necessary spots on the Status Report sheet.  Some days the status of a peice of equipment may change more than one time, for instance, in the morning, when logged, it may be "Green", but later in the afternoon, It changes to "Red." Thought its necessary to track these changes on the individual sheets, for the report only the actual current status of the equipment at the time is necessary, so only whatever row has the most recent information for that date needs to be copied over to the Hidden Data sheet.  I'm sure all this would have been much easier to do in Access, but the users this is intended for are already using excel for a different workbook, so they are familiar with using excel, and I don't want to confuse them (they are easily confused).

Thank you all in advance for your assistance, and again to all those here who've helped with this workbook so far.  This is it, this one change and finally this book will be deployable.

Private Sub Worksheet_Change(ByVal Target As Range)
          If Target.Address <> [G3].Address Then Exit Sub
          If Not IsDate(Target.Value) Then
               MsgBox "Value entered into " & Target.Address & " is not a date"
               Exit Sub
          End If
          If Target.Value > 0 Then
            Sheets("Hidden Data").Range("A1").Value = Target.Value
            Dim ws As Worksheet
            Dim fnd As Range
            Application.ScreenUpdating = False
            Application.EnableEvents = False
            For Each ws In ThisWorkbook.Worksheets
                 If ws.Name <> "Status Report" And ws.Name <> "Hidden Data" Then
                      ws.Activate
                      Set fnd = ws.Range("A:A").Find(Target.Value, , xlValues, xlWhole)
                      If fnd Is Nothing Then
                        Sheets("Hidden Data").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Value = "'"
                      End If
                      If Not fnd Is Nothing Then
                        fnd.EntireRow.Select
                           fnd.EntireRow.Copy
                           Sheets("Hidden Data").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
                      End If
                 End If
            Next
          End If
          Sheets("Status Report").Activate
          Application.ScreenUpdating = True
          Application.EnableEvents = True
     End Sub
Start Free Trial
[+][-]03.27.2007 at 11:58AM PDT, ID: 18802553

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.

 
[+][-]03.27.2007 at 12:34PM PDT, ID: 18802864

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.

 
[+][-]03.27.2007 at 02:26PM PDT, ID: 18803739

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.

 
[+][-]03.27.2007 at 03:13PM PDT, ID: 18804008

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.

 
[+][-]03.27.2007 at 03:19PM PDT, ID: 18804042

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: Visual Basic v1.0.5.x, Microsoft Excel Spreadsheet Software, VB Script
Sign Up Now!
Solution Provided By: jennynover
Participating Experts: 1
Solution Grade: B
 
 
[+][-]03.27.2007 at 05:26PM PDT, ID: 18804708

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.

 
[+][-]03.30.2007 at 05:14PM PDT, ID: 18827175

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.

 
[+][-]03.30.2007 at 05:58PM PDT, ID: 18827290

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.

 
 
Loading Advertisement...
20081112-EE-VQP-44