Closed Thread
Results 1 to 5 of 5

User Form Info

  1. #1
    Peter
    Guest

    User Form Info

    Hello,
    I would just like to know if there is a way through VBA to retrieve data
    from a cell and copy that back into a userform, and set it so that data
    cannot be modified on the userform.
    The data in question resides in a single cell at "H96" , and needs to be
    read into the userform when it is first activated.

    Thanks
    Peter

  2. #2
    Dave Peterson
    Guest

    Re: User Form Info

    Put the value in a Label on that userform?
    Or put it in a textbox that's not enabled??

    Option Explicit
    Private Sub UserForm_Initialize()
    Me.Label1.Caption = Worksheets("sheet1").Range("h96").Value 'text???
    'or
    With Me.TextBox1
    .Value = Worksheets("sheet1").Range("h96").Value 'text???
    .Enabled = False
    End With
    End Sub
    Peter wrote:
    >
    > Hello,
    > I would just like to know if there is a way through VBA to retrieve data
    > from a cell and copy that back into a userform, and set it so that data
    > cannot be modified on the userform.
    > The data in question resides in a single cell at "H96" , and needs to be
    > read into the userform when it is first activated.
    >
    > Thanks
    > Peter


    --

    Dave Peterson

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Peter

    yes a macro can read the value af cell h96 and have that displayed on a form in a way that it can not be modified by the user

    here is one way

    Private Sub UserForm_Initialize()
    Me.Label1.Caption = Range("h96")
    End Sub

  4. #4
    Peter
    Guest

    Re: User Form Info

    Thankyou both, Works a treat.

    Any reccomended reading for excel programming? I like the VBA system for
    some reason.

    Thanks again
    Peter

    "mudraker" wrote:

    >
    > Peter
    >
    > yes a macro can read the value af cell h96 and have that displayed on
    > a form in a way that it can not be modified by the user
    >
    > here is one way
    >
    > Private Sub UserForm_Initialize()
    > Me.Label1.Caption = Range("h96")
    > End Sub
    >
    >
    > --
    > mudraker
    > ------------------------------------------------------------------------
    > mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
    > View this thread: http://www.excelforum.com/showthread...hreadid=532475
    >
    >


  5. #5
    Dave Peterson
    Guest

    Re: User Form Info

    Debra Dalgleish has a list of books at her site:
    http://www.contextures.com/xlbooks.html

    John Walkenbach's is a nice one to start with.

    Depending on how advanced you are...

    Professional Excel Development
    By Stephen Bullen, Rob Bovey, John Green

    See if you can find them in your local bookstore/internet site and you can
    choose what one you like best.

    Peter wrote:
    >
    > Thankyou both, Works a treat.
    >
    > Any reccomended reading for excel programming? I like the VBA system for
    > some reason.
    >
    > Thanks again
    > Peter
    >
    > "mudraker" wrote:
    >
    > >
    > > Peter
    > >
    > > yes a macro can read the value af cell h96 and have that displayed on
    > > a form in a way that it can not be modified by the user
    > >
    > > here is one way
    > >
    > > Private Sub UserForm_Initialize()
    > > Me.Label1.Caption = Range("h96")
    > > End Sub
    > >
    > >
    > > --
    > > mudraker
    > > ------------------------------------------------------------------------
    > > mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
    > > View this thread: http://www.excelforum.com/showthread...hreadid=532475
    > >
    > >


    --

    Dave Peterson

Closed 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