Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 2 quick questions

Hi, my project is coming close to being finished. Just got 2 problems
cant solve:

1)

I have a UserForm with lots of text boxes. Whenever I change the valu
in one of them I'm updating a graph. Now I'm doing
txtWhatever_AfterUpdate() for every text box in the form, then callin
the same update function in every one of them. Shouldn't I be able t
catch a change in any text box?


2)

The worksheet has an equation that depends on several input cell
(connected to my UserForm). I want to test what happens if one of thes
input values vary between 2 integers. I've written a function tha
takes a start and a stop value (say, from 2-7), loops through them all
calculating the result. The method I'm using however is, to say th
least, ugly! I take the range (2-7). Find a free space in th
worksheet, paste every value between 2 and 7 into a column of cells
Then for each value, I calculate the result with the formula, enter th
result in a column one step to the right of the input values. Then
use those 2 columns to make a graph.
Shouldn't I be able to store everything in an array or something, the
in VBA create the graph, so that I don't have to write stuff to th
worksheet?

Any help apprechiated!

/ phreu

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 2 quick questions

Hi phreud,

1)
Looks like it's possible to adapt John Walkenbach's Class Module trick to
TextBox/_AfterUpdate:

http://j-walk.com/ss/excel/tips/tip44.htm

HTH
Anders Silven

"phreud " skrev i meddelandet
...
Hi, my project is coming close to being finished. Just got 2 problems I
cant solve:

1)

I have a UserForm with lots of text boxes. Whenever I change the value
in one of them I'm updating a graph. Now I'm doing a
txtWhatever_AfterUpdate() for every text box in the form, then calling
the same update function in every one of them. Shouldn't I be able to
catch a change in any text box?


2)

The worksheet has an equation that depends on several input cells
(connected to my UserForm). I want to test what happens if one of these
input values vary between 2 integers. I've written a function that
takes a start and a stop value (say, from 2-7), loops through them all,
calculating the result. The method I'm using however is, to say the
least, ugly! I take the range (2-7). Find a free space in the
worksheet, paste every value between 2 and 7 into a column of cells.
Then for each value, I calculate the result with the formula, enter the
result in a column one step to the right of the input values. Then I
use those 2 columns to make a graph.
Shouldn't I be able to store everything in an array or something, then
in VBA create the graph, so that I don't have to write stuff to the
worksheet?

Any help apprechiated!

/ phreud


---
Message posted from http://www.ExcelForum.com/


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 2 quick questions

Certainly looks promising. Thanks alot!

Anyone got an answer for number 2? :

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 2 quick questions

It may look promising, but afterupdate can not be handled using John's
technique.

I believe Anders is mistaken. A textbox does not have an afterupdate event.
The control object has the afterupdate event. You can't handle container
events using John's Method - at least no one has ever posted a way to do it
that I am aware of. Or maybe Anders can come back and take us all to class.

--
Regards,
Tom Ogilvy

"phreud " wrote in message
...
Certainly looks promising. Thanks alot!

Anyone got an answer for number 2? :)


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 2 quick questions

You're right. I tried to adapt John's method to make it work in my case
but couldn't.

However, surely a TextBox has an AfterUpdate event? The code I'm usin
now is:


Code
-------------------

Private Sub txtSomeName1_AfterUpdate()
Update_Chart
End Sub

Private Sub txtSomeName2_AfterUpdate()
Update_Chart
End Sub

Private Sub txtSomeName3_AfterUpdate()
Update_Chart
End Sub

Private Sub txtSomeName4_AfterUpdate()
Update_Chart
End Sub

-------------------


and so on....

This was the reason for my post. It seems there should be a way to ge
around this. I have about 50 text boxes that need to be called lik
this :

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 2 quick questions

The afterupdate is "inherited" from the controls object. So no, the textbox
itself does not have the AfterUpdate event. If you put the same textbox
control on a worksheet, you will see there is no AfterUpdate event as an
illustration. Another example of "inheritance". On a userform, the
combobox has a rowsource, but on a worksheet it is ListFillRange. This is
because these properties belong to the control and oleobject objects
respectively.

--
Regards,
Tom Ogilvy

"phreud " wrote in message
...
You're right. I tried to adapt John's method to make it work in my case,
but couldn't.

However, surely a TextBox has an AfterUpdate event? The code I'm using
now is:


Code:
--------------------

Private Sub txtSomeName1_AfterUpdate()
Update_Chart
End Sub

Private Sub txtSomeName2_AfterUpdate()
Update_Chart
End Sub

Private Sub txtSomeName3_AfterUpdate()
Update_Chart
End Sub

Private Sub txtSomeName4_AfterUpdate()
Update_Chart
End Sub

--------------------


and so on....

This was the reason for my post. It seems there should be a way to get
around this. I have about 50 text boxes that need to be called like
this :(


---
Message posted from http://www.ExcelForum.com/



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 2 quick questions

Tom is right, as always. Please disregard my post.

Or maybe Anders can come back and take us all to class.

Wouldn't dream of it. I can probably teach you nothing.

Best regards,
Anders Silven

P.S.
Johns method "works" with MsForms.TextBox/_Change but the event will be
triggered by every keystroke, so I don't think that is an option (XL2002).
'*****
Public WithEvents TextBoxGroup As MSForms.TextBox

Private Sub TextBoxGroup_Change()
Beep
End Sub
'*****

"Tom Ogilvy" skrev i meddelandet
...
It may look promising, but afterupdate can not be handled using John's
technique.

I believe Anders is mistaken. A textbox does not have an afterupdate event.
The control object has the afterupdate event. You can't handle container
events using John's Method - at least no one has ever posted a way to do it
that I am aware of. Or maybe Anders can come back and take us all to class.

--
Regards,
Tom Ogilvy


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
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
Quick Access Toolbar questions 3phoenix Excel Discussion (Misc queries) 1 April 23rd 07 07:34 AM
Extremely frusterated. 3 quick questions Chris Excel Worksheet Functions 6 June 17th 06 08:32 PM
two quick questions on excel. please answer as soon as possible... Microofficetester Excel Worksheet Functions 6 December 17th 04 01:42 AM


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"