User Interface: Populating and editing sheet data from different sheet

michux

New Member
Joined
Nov 12, 2015
Messages
1
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.


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)
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,215,833
Messages
6,127,157
Members
449,367
Latest member
w88mp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top