#1   Report Post  
Posted to microsoft.public.excel.misc
Peter
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
mudraker
 
Posts: n/a
Default User Form Info


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

  #4   Report Post  
Posted to microsoft.public.excel.misc
Peter
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I create an Excel User Form without VB install on my PC? Novice Excel Discussion (Misc queries) 1 April 11th 06 04:05 PM
user form related TUNGANA KURMA RAJU Excel Discussion (Misc queries) 3 March 23rd 06 12:17 PM
Command Button on User form for Printing Anthony Slater Excel Discussion (Misc queries) 2 September 7th 05 02:01 PM
I need to disable to X on a user form cwwolfdog Excel Discussion (Misc queries) 2 March 28th 05 02:33 AM
A "previous" button on a user form Anthony Slater Excel Discussion (Misc queries) 3 November 29th 04 05:57 PM


All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"