+ Reply to Thread
Results 1 to 3 of 3

Basic EXCEL VBA - input to cell help

Hybrid View

  1. #1
    Registered User
    Join Date
    01-24-2005
    Posts
    6

    Basic EXCEL VBA - input to cell help

    I am at an intermediatte level of Visual BASIC programming and I thought it would be beneficial to learn how to adapt VB for Excel (i.e. VBA)

    I am trying to write code for my spreadsheet that, on a button press, loads a userform with many input boxes/ drop downs etc. The problem I am having is getting the inputs into excel. For one input box, you have to enter age. I want to use VBA to put this in cell (say G5) so a formula in another cell can calculate age group. I.e. using an excel IF foruma which is quite straightforward.

    I would appreciate any help / code that would put a string of characters / numbers from a user form text box into a cell on my excell spreadsheet

    Thanks
    Matt Casim

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Mattcasim,

    To place the contents of the TextBox onto the worksheet do the following:

    Worksheets("Sheet1").Range("G5").Value = TextBox1.Text

    You may need to change the name of the Worksheet an the TextBox if they are named differently in your code.

    Hope this answers your question,
    Leith Ross

  3. #3
    Registered User
    Join Date
    01-24-2005
    Posts
    6
    how would i reverse this? I want to get the contents of cell B3 into a text box in my userform.

    Many Thanks

+ 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