Textbox to multiple sheets

  • I have a userform textbox that I would like to send the value to multible sheets.
    The value to sheet1 is

    Code
    Private Sub txtfirstName_AfterUpdate()
        Range("FirstName")(txtRow.Text).Value = txtFirstName.Value
    End Sub


    I tried this

    Code
    Sheets("Date Info").Select
     Range("DateFirstName")(txtRow.Text).Text = txtFirstName.Value


    but as always no luck.

    [SIZE=2]I should change my name to STUMBED![/SIZE]

  • Re: Textbox to multiple sheets


    I want the value placed within range "DateFirstName" on sheet "Date Info".
    The txtrow box contains the row value.
    The box is located on a user form in sheet "Data" and the values for that page are placed with

    Code
    Range("FirstName")(txtRow.Text).Value = txtFirstName.Value

    [SIZE=2]I should change my name to STUMBED![/SIZE]

  • Re: Textbox to multiple sheets


    Quote from chrisxs5

    I want the value placed within range "DateFirstName" on sheet "Date Info".
    The txtrow box contains the row value.
    The box is located on a user form in sheet "Data" and the values for that page are placed with

    Code
    Range("FirstName")(txtRow.Text).Value = txtFirstName.Value


    Oh, I thought you wanted it on many sheets...


    Try this


    Code
    Range("FirstName").Cells(txtrow.Value) = txtfirstname.Value
  • Re: Textbox to multiple sheets


    Sorry for not better describing but that one box will go to just those two pages. I tried that line of code and it didnt work, I didnt really see anything that named the specific sheet so I edited it to

    Code
    Range("DateFirstName").Cells(txtRow.Value) = txtFirstName.Value
    
    
    and
    
    
        Sheets("Date Info").Range("DateFirstName").Cells(txtRow.Value) = txtFirstName.Value

    Neither worked.

    [SIZE=2]I should change my name to STUMBED![/SIZE]

  • Re: Textbox to multiple sheets


    If you have a multicell range called DateFirstName in your workbook, my code will work - thewre is no need to specify the sheet if its a defined name.


    When you say "it didnt work" - what happened? Anything, nothing or an error?


    Do you have a ranged named that? How big is it? What was the value in txtrow ?


    The more info you give, the more likely you are to get a solution.


    BTW - I tested the code - it works fine - BUT, I made assumtions about your data & set up so it's most likely the assumptions were wrong, not the code ;)

  • Re: Textbox to multiple sheets


    Thanks willr your code did do it, the problem was in a offset formula in my named range, I got that worked out and the code did the trick, thanks.

    [SIZE=2]I should change my name to STUMBED![/SIZE]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!