+ Reply to Thread
Results 1 to 2 of 2

Entering data into two text boxes using one command button

  1. #1
    Registered User
    Join Date
    03-24-2006
    Posts
    1

    Entering data into two text boxes using one command button

    Hi

    I have the following code in a workbook:

    Please Login or Register  to view this content.
    I would like for the button to fill another text box (called EmailBody) at the same time, but I don't know how to get it to fill the two boxes.

    Can anyone please advise me on what I need to change in the above code to get this to work?

    Thanks very much

    CC

  2. #2
    Tom Ogilvy
    Guest

    RE: Entering data into two text boxes using one command button

    EmailSubject.Text = EmailSubject & strText & vbCrLf
    EmailBody.Text = "whatever"

    --
    Regards,
    Tom Ogilvy


    "Charlie Chalk" wrote:

    >
    > Hi
    >
    > I have the following code in a workbook:
    >
    >
    > Code:
    > --------------------
    >
    > 'takes data from cell A45 (Phase Instructions worksheet) and puts into textbox
    > Private Sub CreateEmail_Click()
    > On Error GoTo ErrHandler
    > Dim strText As String
    > For Each r In Sheets("Phase instructions").Range("A45").Rows
    > strText = ""
    > For Each c In r.Cells
    > strText = strText & c.Value
    > Next c
    > EmailSubject = EmailSubject & strText & vbCrLf
    > Next r
    > ExitPoint:
    > Exit Sub
    >
    > ErrHandler:
    > If Err.Number = 999 Then
    > Resume Next
    > Else
    > MsgBox "Incorrect data for this printer, please re-enter", vbCritical, "PRINTER DATA ERROR"
    > Resume ExitPoint
    > End If
    > End Sub
    >
    > --------------------
    >
    >
    > I would like for the button to fill another text box (called EmailBody)
    > at the same time, but I don't know how to get it to fill the two boxes.
    >
    >
    > Can anyone please advise me on what I need to change in the above code
    > to get this to work?
    >
    > Thanks very much
    >
    > CC
    >
    >
    > --
    > Charlie Chalk
    >
    >
    > ------------------------------------------------------------------------
    > Charlie Chalk's Profile: http://www.excelforum.com/member.php...o&userid=32776
    > View this thread: http://www.excelforum.com/showthread...hreadid=526052
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1