Excel VBA problem with updating worksheet based upon filtered listbox selectd on

lboromark

New Member
Joined
Jul 24, 2015
Messages
3
Hi I need some help to finish off the userform I have been cobbling together. It is to handle data entry and record when data has been reviewed and deleted

I have also posted the same question (earlier version of requirements) at excelforum.com - Link - they helped me with the filtered listbox but havent been able to provide a solution to my last requirement with the filtered listbox - or i havent understood it properly (which is more likely!!)

There is also the latest version of the workbook on the last post - thanks in advance for any help in resolving this


The form currently allows the following:
  • Create a new record and write it to the spreadsheet
  • Create a folder structure based on the information provided in the data entry page
  • A second page displaying a listbox of all of the data currently in the worksheet.
    • A user can select a record and a "consultant name" and then mark the data as deleted or reviewed
      • Doing this writes to the relevant record / row in the worksheet and fills in the date and consultants name - code is below:
Code:
<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit;">Private Sub cmdPeerReview_Click()
    Dim r As Long
    For r = 0 To lstRecords.ListCount - 1
        If lstRecords.Selected(r) Then
            Worksheets("Data Storage").Cells(lstRecords.List(r, UBound(lstRecords.List, 2)), 9) _
            .Resize(, 3).Value = Array("Yes", cboConsultantName2.Value, Now())
            MsgBox "Data Peer Reviewed"
        End If
    Next
End Sub</code>



  • A second listbox that displays all records for a particular customer based upon what is selected in a combobox

Code:
Private Sub cboCustomers_Change()
    With Me
        .lstRecords.Clear
        If Me.cboCustomers.ListIndex > -1 Then .lstRecords.Column = dic(.cboCustomers.Value)
                                               .lstRecords.ColumnCount = 7
                                               .lstRecords.ColumnHeads = True
                                               .lstRecords.ColumnWidths = "75;75;80;125;80;80"
    End With
End Sub


What is missing / not working
  • being able to select a record from the second listbox and mark it as deleted or reviewed in the worksheet

Please see below for screenshots of the expected user experience and the error that I am currently getting:
attachment.php


attachment.php


attachment.php
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top