Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell value to text box?


i'm having problems with getting a cell value into a textbox in a
userform.

my problem is that i am trying to get a cell value in a worksheet
displayed into a textbox in my userform with vba but can't find the
right code.

any ideas?

:)


--
tomro1
------------------------------------------------------------------------
tomro1's Profile: http://www.excelforum.com/member.php...o&userid=35081
View this thread: http://www.excelforum.com/showthread...hreadid=548293

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell value to text box?


Try this in the event procedure that you activate to transfer the value

Lets say your UserForm = UserForm1
and TextBox = TextBox1
and Sheet = Sheet1

UserForm1.TextBox1.Value = Sheet1.Range("A1").Value


--
KellTainer
------------------------------------------------------------------------
KellTainer's Profile: http://www.excelforum.com/member.php...o&userid=34322
View this thread: http://www.excelforum.com/showthread...hreadid=548293

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell value to text box?


KellTainer Wrote:

UserForm1.TextBox1.Value = Sheet1.Range("A1").Value



it still has a problem with "sheet1", he doesn't recognizes it.

i also have tried

textbox1.value = sheets("sheet1") range("a1").value

but also doens't work


--
tomro1
------------------------------------------------------------------------
tomro1's Profile: http://www.excelforum.com/member.php...o&userid=35081
View this thread: http://www.excelforum.com/showthread...hreadid=548293

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cell value to text box?


hmm, you have to modify the code to suit your needs. just change the
different variables to suit your application.


--
KellTainer
------------------------------------------------------------------------
KellTainer's Profile: http://www.excelforum.com/member.php...o&userid=34322
View this thread: http://www.excelforum.com/showthread...hreadid=548293

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default cell value to text box?

It is possible to change the name of the sheet in the VBE environment
under the properties of the worksheet object. This name is different
from the name you give a sheet via the tab in excel. Normally the first
sheet can always be referenced as "sheet1" unless the internal name has
been altered. To check this go to the VBE and look at the properties
box for the sheet you need to work with. The first property listed will
be (name) and it's value is what you want to use in place of "sheet1".
In the future I would avoid changing this name property unless you
really need to (if that turns out to be the problem)

Hope this helps.


tomro1 wrote:
KellTainer Wrote:

UserForm1.TextBox1.Value = Sheet1.Range("A1").Value



it still has a problem with "sheet1", he doesn't recognizes it.

i also have tried

textbox1.value = sheets("sheet1") range("a1").value

but also doens't work


--
tomro1
------------------------------------------------------------------------
tomro1's Profile: http://www.excelforum.com/member.php...o&userid=35081
View this thread: http://www.excelforum.com/showthread...hreadid=548293




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
Find text in a cell and copy text to another cell Shaun Excel Discussion (Misc queries) 6 July 4th 07 05:25 PM
Copy text from cell to cell with one cell changing text Bobby Excel Worksheet Functions 5 March 15th 07 11:09 PM
New text added to cell AFTER current text in same cell choc_penguin Excel Worksheet Functions 2 April 11th 06 08:23 PM
Deleting Rows based on text in cell & formatting cell based on text in column beside it Steve Excel Programming 4 February 26th 04 03:31 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


All times are GMT +1. The time now is 02:42 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"