I am new to VBA and need some help getting started so bear with me here.
I have names and information in sheet2 and a user interface in sheet1. I am trying to edit names and their corresponding information in sheet1 by picking the name to edit through a userform listbox and having their information populated in sheet 1. I was thinking it could then be edited and resubmitted into sheet2 however I haven't gotten that far yet.
I was doing this through the userform collecting the name that needed to be edited and inputting into the first empty row, first column of sheet1. Then I wanted this test code to automatically populate the name's information so it could be then edited.
I am pretty sure I am going about this the wrong way and need help!! Any advice would be greatly appreciated, or direction to good posts that are easy to understand about this!
(I understand that the above code will only work for the one name and that the workbook_sheetchange function is not working for a variety of reasons)
I have names and information in sheet2 and a user interface in sheet1. I am trying to edit names and their corresponding information in sheet1 by picking the name to edit through a userform listbox and having their information populated in sheet 1. I was thinking it could then be edited and resubmitted into sheet2 however I haven't gotten that far yet.
I was doing this through the userform collecting the name that needed to be edited and inputting into the first empty row, first column of sheet1. Then I wanted this test code to automatically populate the name's information so it could be then edited.
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim PName As Range
Set PName = Sheet1.Range("A3")
If IsEmpty(PName) = False Then
Sheet1.Range("B3").Value = _
Application.VLookup(PName.Value, Sheet2.Range("A3:F9"), 3, False)
End If
End Sub
I am pretty sure I am going about this the wrong way and need help!! Any advice would be greatly appreciated, or direction to good posts that are easy to understand about this!
(I understand that the above code will only work for the one name and that the workbook_sheetchange function is not working for a variety of reasons)