Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

How to assign text to forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ayo - 31 May 2008 02:06 GMT
Is there a way to assign the active or selected cell on a worksheet to a
TextBox on a form? This is what I have to far but it is not working.

Private Sub txtSiteRw_Change()
   txtSiteRw.Value = Application.ActiveCell.Address
   If txtSiteRw.Value = "" Then
       Me.cmdFillForm.Enabled = False
   ElseIf txtSiteRw.Value <> "" Then
       Me.cmdFillForm.Enabled = True
   End If
End Sub

Any help will be greatly appreciated.
Rick Rothstein (MVP - VB) - 31 May 2008 08:53 GMT
You haven't provided enough information on *how* you are trying to implement
this functionality. For example, is the UserForm (I presume you meant
UserForm when you said "form") already showing when you are trying to do
this? If so, what event are you using to "kick" your code off (that is, are
you pushing a "Get Active Cell" button to implement your functionality, or
clicking inside the TextBox, or clicking the UserForm, etc.)? If the
UserForm is not already showing, are you doing something on the worksheet
that shows the UserForm and, when shown, you want the TextBox to pick up the
contents of the active cell when loading? I can tell you that the Change
event for the TextBox is probably the wrong place to try and implement your
code (that event will not take place until something changes the text within
the TextBox itself). Provide some more detail on how you want to implement
the functionality you seek and someone here will be able to give you code to
do it.

Rick

> Is there a way to assign the active or selected cell on a worksheet to a
> TextBox on a form? This is what I have to far but it is not working.
[quoted text clipped - 9 lines]
>
> Any help will be greatly appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.