ANmarS - Search results

Excel/VBA expert since Sep 1997 (20 years 9 months)

We are moving ...

We are moving to another location, better, faster and more resources .... check it out ANmar.Systems

2 Q & A posts tagged with Userform

Thu
Apr 23
2009

Microsoft Excel - Treeview 6.0 in User form?

I have treeview 6.0 in a user form. Does anyone know how to link charts or data to the tree view, to display in a window in the user form when clicking a node? Any help would be GREATLY appreciated. Thanks!


Answer

Since you are in the VBE of Excel, you can do this

- Draw a picture box that shows when the user clicks the node
- Copy the chart and paste it as picture in some temp sheet
- Then read that picture into that picture box

This is what I have in mind right now, I think there are other ways...

Let me know what you came up with, I liked your advanced question


VBAXLMan

Thursday 4/23/2009 9:05:09 AM
Mon
Apr 13
2009

In an Excel Macro, how do I return a value that the user selects in a userform?

For instance, the user can select one of three options via an option (radio) button (i.e. apple, orange, banana). I need code that will return this selection to module1 as a variable.


Answer

Paste this in your userform assuming:
1- You have the names of the radio buttons as Option1, Option2, etc
2- The user clicks Ok (named as "CmdOk")

sub CmdOk_Click()
If Option1.Value then Option_Sel=1
If Option2.Value then Option_Sel=2
' Do as many lines as you have in your Options
end sub

Then paste this in Module1

Public Option_Sel as integer


This will make the Option_Sel as global variable and then you can use it in any sub in your entire project


Let me know if that is fine or not


VBAXLMan

Monday 4/13/2009 8:58:02 AM

Tags

History