sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,422
- Office Version
- 2016
- Platform
- Windows
I'm trying to update a worksheet using the ListIndex of a Listbox, like this;
The code runs fine, gives no errors and produces the message at the end, however, the values are not being populated to the relevant cells on the worksheet.
Can anyone spot where this may be going wrong?
Code:
Row = ListBox1.ListIndex + 2
With Sheets("Contacts List")
Range("A" & Row).Value = TextName.Value
Range("B" & Row).Value = ComboType.Value
Range("C" & Row).Value = TextRelationship.Value
Range("D" & Row).Value = TextReligion.Value
Range("E" & Row).Value = TextTelephone.Value
Range("F" & Row).Value = TextEmail.Value
Range("G" & Row).Value = TextAddress.Value
End With
Call MsgBox("Contact updated successfully", vbInformation, "Success")
The code runs fine, gives no errors and produces the message at the end, however, the values are not being populated to the relevant cells on the worksheet.
Can anyone spot where this may be going wrong?