Avatar of Sara Hedtler
Sara Hedtler

asked on 

Specific Cell Loaded into a Specific Userform Textbox

I'm creating a form and need to have specific cell copied to an excel userform textbox when the userform is opened.  Main_Form.xlsm
* userformsVBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Martin Liss
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Intersect(Target, Range("D1:G16").CurrentRegion) Is Nothing Then Exit Sub
    
    With Main_Form
      '  .txtAmsID = Cells("D15")
        'Main_Form.txtAmsID = Cells(Rows.Cells, "D15")
        .txtAmsID = Sheets("Sheet2").Cells(Target.Row, "D")
    Main_Form.Show
    End With
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Sara Hedtler
Sara Hedtler

ASKER

Thank you so much, that is exactly what I was trying to do.
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
              Experts Exchange Top Expert VBA (current)
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo