You clarified! I was using the textbox from the VB tools in Excel. Now
I am lead to try the other methods. Yes, Microsoft does make it hard.
>I'm going to give this a shot even though I don't fully understand
>everything thats going on myself. I do hope others will chime in if
>(likely) I make a mistake here.
>My first comment is that as of Visual Basic Version 5, the VB and VBA
>languages are one and the same. Not just similar, but precisely the
>*same*. Every visual basic program references the same "Visual Basic
>for Applications" library that an Excel (or Word or PowerPoint) project
>does. There is in fact only the "Visual Basic for Applications"
>language that is used across all MS applications as well as some other
>3rd party applications as well as the Visual Basic compiler itself.
>This is the good news.
>The bad news is that the objects you control using this language (such
>as textboxes) come in (too) many different flavors and revisions.
> *What* textbox ?
>Microsoft throws at least 3 (maybe more?) similar yet maddeningly
>different textboxes at us.
>There is the VB textbox object wrapped up in the Visual Basic runtime
>library. This is probably what you are used to but it is
>*inaccessable* to Excel, even though you might have the Visual Basic
>compiler installed on your machine. Did you mean to paste this on an
>Excel spreadsheet? If so just forget it. There are (2) other
>textboxes that you can use, however. Just know that they will not work
>*exactly* the same as the Visual Basic compilers' textbox.
>There is the "TextBox" that has been available in many past revisions
>of Excel and is still available in Excel 2000. This is the one you
>typically draw on a worksheet using the "Drawing" toolbar. This gizmo
>is really handy and reliable. Even though it doesn't respond to
>events :-( you can give it a logical name and control it through code.
>You can also directly enter a cell reference on the formula bar and the
>text in the textbox will automatically reflect the contents of that
>cell. The referenced cell can be on the same sheet the textbox is on
>OR it can be on another sheet. Just set the formula "=Sheet3!B4". You
>can also just set .Text = "whatever" or .text = worksheets
>("Sheet3").range("B4").value from code. I still use this in Excel 2000
>even though MS is trying to discourage it. Why I still use it is
>explained below.
>The third "textbox" object is the one that comes from the MSForms
>library that is always loaded into an Excel (or Word or PPT) project.
>You typically put this on a spreadsheet by drawing it from the Control
>toolbox. This gizmo is very similar (maddeningly different?) from the
>VB compler textbox. MS wants you to use this. It responds to events :-
>) Seems to work great when used on a UserForm but has, in the past,
>*bombed* horribly when pasted on a spreadsheet. This *might* be fixed
>in Excel 2000 but I am still gunshy and want to hear someone else tell
>me it's "fixed" before I waste anymore time with it. It also permits
>you to directly set a worksheet cell range in its "LinkedCell"
>property. You can also just .text = "whatever" from code.
>Ok - did I clarify or confuse? VB - VBA language the same. Textboxes
>and other objects - different :-( Why, oh why! can't Microsoft put
>out a single TextBox.ocx that you can reference throughout VB and the
>MS office system? I could use some clarification myself.
>-Graphman
>> I know I'm not the greatest VB programmer but I do know some things.
>> I am wondering how to get a textbox to work in Excel97. I have tried
>> everything I know even the simple cmdButton click procedure(see next
>> paragraph). That works but I want it to read a value fron another
>> sheet, which I have identified and put the cell values as (eg) r3c5
>> and it just won't work for me.
>> I just us a standard click procedure and set my text value in the code
>> (because I can't get it to read a cell value yet!). I protect the
>> sheet to see if all is working. Once the button works and I unprotect
>> the sheet to look at the code and I can't get any thing from right
>> clicking on it! Is there a reason for this?
>> I have talked with others who said that writing real VB code, not VBA
>> (I'm not clear on the difference) doesn't always work in Excel. Is
>> there any truth to that or just a good excuse for me to explain why I
>> can't get anything to work.
>> Thanks in advance. Please post answer here...others novices amy need
>> to lean also.
>Sent via Deja.com http://www.deja.com/
>Before you buy.