I've encountered a few challenges and am in need of some assistance. I have a worksheet that houses 42 data elements. Some of these are names that are split into First, Middle, Last and Suffix. I have a user form that will be used for data entry and each of these fields has their own text box. I have another user form (frm_MediaReview) where I want the data in the active cell to display the concatenated name.
1st Issue - frm_MediaReview is displaying whenever a cell in column A is active. That's happening through the code I've posted below. Instead, I'd like the form to only show if someone double clicks a cell in column A.
2nd Issue - How can I either concatenate the 4 name cells into 1 OR use a range? I would think the range would be cleaner, as I will want to use ranges a search function that I'm going to build out.
Private Sub UserForm_Initialize()
Dim Director1Name As Range
With Me
.txt_Title.Value = Cells(ActiveCell.Row, "A").Value
.txt_Status.Value = Cells(ActiveCell.Row, "B").Value
.txt_LoanedTo.Value = Cells(ActiveCell.Row, "C").Value
.txt_BluRay.Value = Cells(ActiveCell.Row, "D").Value
.txt_BluRay3D.Value = Cells(ActiveCell.Row, "E").Value
.txt_DVD.Value = Cells(ActiveCell.Row, "F").Value
.txt_Digital.Value = Cells(ActiveCell.Row, "G").Value
.txt_4KUHD.Value = Cells(ActiveCell.Row, "H").Value
.txt_Platform.Value = Cells(ActiveCell.Row, "I").Value
.txt_Media.Value = Cells(ActiveCell.Row, "J").Value
.txt_Collection.Value = Cells(ActiveCell.Row, "K").Value
.lnk_WebLink.Value = Cells(ActiveCell.Row, "L").Value
.txt_Rating.Value = Cells(ActiveCell.Row, "M").Value
.txt_Length.Value = Cells(ActiveCell.Row, "N").Value
.txt_Released.Value = Cells(ActiveCell.Row, "O").Value
.txt_Director1F.Value = Cells(ActiveCell.Row, "P").Value
.txt_Director1M.Value = Cells(ActiveCell.Row, "Q").Value
.txt_Director1L.Value = Cells(ActiveCell.Row, "R").Value
.txt_Director1S.Value = Cells(ActiveCell.Row, "S").Value
.txt_Director2F.Value = Cells(ActiveCell.Row, "T").Value
.txt_Director2M.Value = Cells(ActiveCell.Row, "U").Value
.txt_Director2L.Value = Cells(ActiveCell.Row, "V").Value
.txt_Director2S.Value = Cells(ActiveCell.Row, "W").Value
.txt_Genre.Value = Cells(ActiveCell.Row, "X").Value
.txt_Genre2.Value = Cells(ActiveCell.Row, "Y").Value
.txt_Star1F.Value = Cells(ActiveCell.Row, "Z").Value
.txt_Star1M.Value = Cells(ActiveCell.Row, "AA").Value
.txt_Star1L.Value = Cells(ActiveCell.Row, "AB").Value
.txt_Star1S.Value = Cells(ActiveCell.Row, "AC").Value
.txt_Star2F.Value = Cells(ActiveCell.Row, "AD").Value
.txt_Star2M.Value = Cells(ActiveCell.Row, "AE").Value
.txt_Star2L.Value = Cells(ActiveCell.Row, "AF").Value
.txt_Star2S.Value = Cells(ActiveCell.Row, "AG").Value
.txt_Star3F.Value = Cells(ActiveCell.Row, "AH").Value
.txt_Star3M.Value = Cells(ActiveCell.Row, "AI").Value
.txt_Star3L.Value = Cells(ActiveCell.Row, "AJ").Value
.txt_Star3S.Value = Cells(ActiveCell.Row, "AK").Value
.txt_Star4F.Value = Cells(ActiveCell.Row, "AL").Value
.txt_Star4M.Value = Cells(ActiveCell.Row, "AM").Value
.txt_Star4L.Value = Cells(ActiveCell.Row, "AN").Value
.txt_Star4S.Value = Cells(ActiveCell.Row, "AO").Value
.txt_Synopsis.Value = Cells(ActiveCell.Row, "AP").Value
.txt_Director1Name = Range(ActiveCell.Range, "Director1Name").Value
End With
End Sub
1st Issue - frm_MediaReview is displaying whenever a cell in column A is active. That's happening through the code I've posted below. Instead, I'd like the form to only show if someone double clicks a cell in column A.
2nd Issue - How can I either concatenate the 4 name cells into 1 OR use a range? I would think the range would be cleaner, as I will want to use ranges a search function that I'm going to build out.
Private Sub UserForm_Initialize()
Dim Director1Name As Range
With Me
.txt_Title.Value = Cells(ActiveCell.Row, "A").Value
.txt_Status.Value = Cells(ActiveCell.Row, "B").Value
.txt_LoanedTo.Value = Cells(ActiveCell.Row, "C").Value
.txt_BluRay.Value = Cells(ActiveCell.Row, "D").Value
.txt_BluRay3D.Value = Cells(ActiveCell.Row, "E").Value
.txt_DVD.Value = Cells(ActiveCell.Row, "F").Value
.txt_Digital.Value = Cells(ActiveCell.Row, "G").Value
.txt_4KUHD.Value = Cells(ActiveCell.Row, "H").Value
.txt_Platform.Value = Cells(ActiveCell.Row, "I").Value
.txt_Media.Value = Cells(ActiveCell.Row, "J").Value
.txt_Collection.Value = Cells(ActiveCell.Row, "K").Value
.lnk_WebLink.Value = Cells(ActiveCell.Row, "L").Value
.txt_Rating.Value = Cells(ActiveCell.Row, "M").Value
.txt_Length.Value = Cells(ActiveCell.Row, "N").Value
.txt_Released.Value = Cells(ActiveCell.Row, "O").Value
.txt_Director1F.Value = Cells(ActiveCell.Row, "P").Value
.txt_Director1M.Value = Cells(ActiveCell.Row, "Q").Value
.txt_Director1L.Value = Cells(ActiveCell.Row, "R").Value
.txt_Director1S.Value = Cells(ActiveCell.Row, "S").Value
.txt_Director2F.Value = Cells(ActiveCell.Row, "T").Value
.txt_Director2M.Value = Cells(ActiveCell.Row, "U").Value
.txt_Director2L.Value = Cells(ActiveCell.Row, "V").Value
.txt_Director2S.Value = Cells(ActiveCell.Row, "W").Value
.txt_Genre.Value = Cells(ActiveCell.Row, "X").Value
.txt_Genre2.Value = Cells(ActiveCell.Row, "Y").Value
.txt_Star1F.Value = Cells(ActiveCell.Row, "Z").Value
.txt_Star1M.Value = Cells(ActiveCell.Row, "AA").Value
.txt_Star1L.Value = Cells(ActiveCell.Row, "AB").Value
.txt_Star1S.Value = Cells(ActiveCell.Row, "AC").Value
.txt_Star2F.Value = Cells(ActiveCell.Row, "AD").Value
.txt_Star2M.Value = Cells(ActiveCell.Row, "AE").Value
.txt_Star2L.Value = Cells(ActiveCell.Row, "AF").Value
.txt_Star2S.Value = Cells(ActiveCell.Row, "AG").Value
.txt_Star3F.Value = Cells(ActiveCell.Row, "AH").Value
.txt_Star3M.Value = Cells(ActiveCell.Row, "AI").Value
.txt_Star3L.Value = Cells(ActiveCell.Row, "AJ").Value
.txt_Star3S.Value = Cells(ActiveCell.Row, "AK").Value
.txt_Star4F.Value = Cells(ActiveCell.Row, "AL").Value
.txt_Star4M.Value = Cells(ActiveCell.Row, "AM").Value
.txt_Star4L.Value = Cells(ActiveCell.Row, "AN").Value
.txt_Star4S.Value = Cells(ActiveCell.Row, "AO").Value
.txt_Synopsis.Value = Cells(ActiveCell.Row, "AP").Value
.txt_Director1Name = Range(ActiveCell.Range, "Director1Name").Value
End With
End Sub