Modify names with a button

Closed
Luisa - Jun 11, 2010 at 09:39 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jun 12, 2010 at 03:55 AM
Hello,

I started having problems again with mi file, I spent two days trying to figure it out what happend but I don't know. The problems that I'm having are two basically.

1. I'm using a form with two buttons, one to create client names and the other button to modify existing names of the clients, but when i try to save them only deletes lines, thus is not modifying the names for example from mario to luisa, instead of that is giving me an empty space.

2. I also want the names to be sorted by alphabetical order and is doing it but not at all, let me explain myself better, example:

mario
luis
betty
catrina

the code is organizing the names in alphabetical order but is living the first row empty thus thedropdown menu is returning sometimes no names or some of them.

Here is a copy of my file, I would appreciate any help


https://authentification.site/files/22915697/mODIFY_CLIENTS.xlsm

,



Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 12, 2010 at 03:55 AM
This is causing that issue
Private Sub ComboBox1_Click()
Dim i As Integer
Dim final As Integer

For i = 2 To 1000
If Sheet20.Cells(i, 1) = "" Then
final = i - 1
Exit For
End If
Next

For i = 2 To final
If UserForm4.ComboBox1 = Sheet20.Cells(i, 1) Then
            Sheet20.Cells(i, 1) = UserForm4.TextBox8
            Exit For
        End If

Next

End Sub


This routine is triggered by you change the combo box. Since at that point you dont have any value in text box, it puts a blank.

Having said that, do you know how to debug the code ? The reason I asked is that coz had you code run in a debug mode, you would have noticed this. Without knowing debugging, coding would be next to impossible as bugs are traced as you follow the flow of code as being is executed.
0