sivakumar123
New Member
- Joined
- Jul 26, 2012
- Messages
- 21
- Office Version
- 365
- Platform
- Windows
Hi,
I have a text box which populates values from a range.
The text box is locked by default.
Once user clicks on an edit button, user will be able to change the value in the text box.
And after changing, once user clicks on one Save button, I need the new value to be updated in the excel sheet in the exact position.
As mentioned above, when user clicks an Edit button, the textbox teamName will be editable, and user can change values in it.
There is also another Save button. I want the exact position in the excel sheet to be updated when user clicks save button in user form.
Best Regards
Sivakumar
Note : This was posted in another forum but has not been answered yet. PFB the link.
Update excel based on userform text box update
I have a text box which populates values from a range.
The text box is locked by default.
Once user clicks on an edit button, user will be able to change the value in the text box.
And after changing, once user clicks on one Save button, I need the new value to be updated in the excel sheet in the exact position.
Code:
Private Sub Members_Click()
ContactForm.teamName.Text = ""
Dim myCell As Variant, myIndex As Integer
Dim teamRng As Range, nameRng As Range
Set nameRng = ContactWorkBook.ActiveSheet.Range("myName")
Set teamRng = ContactWorkBook.ActiveSheet.Range("teamName")
myIndex = 0
For Each myCell In nameRng.Cells
myIndex = myIndex + 1
If myCell = Members.Text Then
ContactForm.editTeam.Enabled = True '[I]The Edit button will be enabled here[/I]
ContactForm.teamName.Value = teamRng(myIndex)
If IsEmpty(teamRng(myIndex)) Then
ContactForm.teamName.Value = "NA"
End If
End If
Next
As mentioned above, when user clicks an Edit button, the textbox teamName will be editable, and user can change values in it.
There is also another Save button. I want the exact position in the excel sheet to be updated when user clicks save button in user form.
Best Regards
Sivakumar
Note : This was posted in another forum but has not been answered yet. PFB the link.
Update excel based on userform text box update