I am having a Database of Some Acts/Rules (in index page) and relevant data spread across 100 sheets. The data from Index Sheet is automatically displayed in the first listbox. Selecting any of the items in the listbox populates the data in 2nd list box. Double clicking on the last item in the list box transfers the data to couple of textboxes.
Now I need to find a way to update the last row of the sheet which was selected from the 1st listbox (ListIndex)
I hope to achieve this by typing updated values into the text box and clicking the "Submit" button.
The code for Submit button is mentioned below. However this is not working as I expected.
I request any Help to resolve the issue.
Now I need to find a way to update the last row of the sheet which was selected from the 1st listbox (ListIndex)
I hope to achieve this by typing updated values into the text box and clicking the "Submit" button.
The code for Submit button is mentioned below. However this is not working as I expected.
I request any Help to resolve the issue.
Code:
Sub Submit()
Dim sh As Worksheet
Dim irow As Long
Set sh = ThisWorkbook.Sheets((lstIndex.List(lstIndex.ListIndex) + 2))
Application.EnableEvents = False
sh.Activate
irow = Cells(Rows.Count, "E").End(xlUp).Row + 1
With sh
.Cells(irow, 5) = frmMain.txtGSR.value
.Cells(irow, 7) = frmMain.txtDate.value
End With
Application.EnableEvents = True
End Sub