Results 1 to 11 of 11

Using one listbox to edit data from multiple worksheets

Threaded View

RoroBear Using one listbox to edit... 07-15-2020, 03:39 AM
Sintek Re: Using one listbox to edit... 07-15-2020, 04:31 AM
RoroBear Re: Using one listbox to edit... 07-15-2020, 09:09 AM
karmapala Re: Using one listbox to edit... 07-15-2020, 06:01 AM
Sintek Re: Using one listbox to edit... 07-15-2020, 09:20 AM
RoroBear Re: Using one listbox to edit... 07-15-2020, 10:14 AM
RoroBear Re: Using one listbox to edit... 07-15-2020, 10:23 AM
karmapala Re: Using one listbox to edit... 07-16-2020, 03:52 AM
RoroBear Re: Using one listbox to edit... 07-16-2020, 08:51 AM
Sintek Re: Using one listbox to edit... 07-16-2020, 03:39 AM
Sintek Re: Using one listbox to edit... 07-16-2020, 08:56 AM
  1. #1
    Forum Contributor
    Join Date
    08-04-2018
    Location
    San Dieg CA
    MS-Off Ver
    Microsoft Office Professional Plus 2016 (Excel 2016 MSO 32 bit)
    Posts
    167

    Using one listbox to edit data from multiple worksheets

    Hello All,

    Reaching out for some help once again. I have a listbox that is populated from a combobox when a worksheet is selected. When I click on a selection in the listbox it populates the corresponding textboxes below. I have the below code that’s supposed to edit whatever selection I make, but instead it edits the entire table. My second problem is that it only works (if you can call it that) on one worksheet (Re-Enlistments). I want to be able to edit all the worksheets in the combobox. Code is below and file is attached. As always, I’m grateful for any assistance.

     Private Sub CommandButton1_Click()
        Dim i As Integer
            For i = 2 To Range("B10000").End(xlUp).Row
            'If Cells(i, 1) >= 1 Then
            If Me.ListBox1.List(Me.ListBox1.ListIndex, 0) = "" Then
         
                Cells(i, 2) = TextBox1.Text
                Cells(i, 3) = TextBox2.Text
                Cells(i, 4) = TextBox3.Text
                Cells(i, 5) = TextBox4.Text
                Cells(i, 6) = TextBox5.Text
                Cells(i, 7) = TextBox6.Text
                Cells(i, 8) = TextBox7.Text
                Cells(i, 9) = TextBox9.Text
                Cells(i, 10) = TextBox10.Text
            End If
        Next i
        MsgBox "Data has been Saved!", vbInformation
        Unload Me
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Search and edit the data from multiple worksheets from userform
    By bujaber10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2019, 10:01 AM
  2. [SOLVED] Edit select data on Listbox
    By kirana2014 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-29-2017, 01:15 AM
  3. Replies: 0
    Last Post: 08-27-2015, 09:44 PM
  4. select multiple column listbox to edit userform
    By tbar05 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2012, 12:13 AM
  5. edit multiple data on multiple worksheets all at once
    By semidevil in forum Excel General
    Replies: 1
    Last Post: 10-17-2010, 06:03 PM
  6. UserForm selected data; to edit multiple worksheets(& specific rows)
    By anonfish in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2010, 11:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1