userform

userform loop for hiding and unhiding through multiple sequences

你。 提交于 2019-12-13 08:27:03
问题 So i have this string of code... It is in a userform and is all vba based (IE not pulling data from a spreadsheet.) Private Sub CHECK1_Click() If CHECK1.value = False Then COMBO1.visible = False Else COMBO1.visible = True End If End Sub It works for perfectly for exactly one checkbox and combobox pair, I need it to work on all 61 on of them, individually... Being new to this I looked at case select possability but it looks like i would have to spell in out. the userform is called "ORDER1" All

Word vba how to save picture from image object to file?

耗尽温柔 提交于 2019-12-13 07:50:06
问题 I have an image object on a userform. I want to save the picture from that image object into a file. I see many examples of how to load a picture into an image object, but none the other way around. I tried stdole.SavePicture obj.Picture, strFilePath , but that only works for button objects. 回答1: First create a Chart. Second place the picture in the Chart. Finally export the Chart. EDIT#1 For sample code see: Save Picture with VBA 回答2: I don't know if this will help, but I tried casting the

Excel VBA: How to loop through checkboxes based on name

别说谁变了你拦得住时间么 提交于 2019-12-13 07:16:44
问题 I want to build a survey using excel and vba. I have a table with questions and answers. As the survey starts, my code will list the answers by overwriting the checkboxes' labels on a form. I will fetch their answer and write them in a column by using True or False value of a checkbox. Variable "aRow" is the number of the answers for each question. "lastAns" is the row number of the last answer. Depending on the number of the answer, some checkboxes will be hidden, shown. "CheckBox1" to

Disable button on a userForm

大城市里の小女人 提交于 2019-12-13 06:52:35
问题 I'm trying to figure out how to disable a button within my userForm if a certain cell within my spreadsheet equals a certain number. I tried the code stated below, but it isn't working. Private Sub UserForm_Initialize() Label2 = Sheets("DATA").Range("AM2").Value Label4 = Sheets("DATA").Range("AO2").Value Label7 = Format(Sheets("DATA").Range("R8").Value, "Currency") If Sheets("DATA").Range("AL10").Value = 10 Then ActiveSheet.Shapes("CommandButton1").Select UserFormact_Upgrade.CommandButton1

In a Userform, Link Textbox to the same row as the combobox but different Column

两盒软妹~` 提交于 2019-12-13 05:42:56
问题 I have created a userform with 2 comboboxes, a textbox and a button that will link the comboboxes/textbox depending on the scenario. For one of the scenarios, if combobox 2, displays the same text/value currently in the worksheet MRFGLR Range Column A change the value of column AE with the textbox value in the same row as the combobox 2 value in Worksheet MFGLR. In a Userform, Link Textbox to the same row as the combobox but different Column I'm having trouble having the code find the same

EXCEL VBA: dblClick, Repetitive Code Improvement

拜拜、爱过 提交于 2019-12-13 04:37:01
问题 I have a bunch of similarly constructed userforms with many identical objects on them. For my labels (which number over 50), I have created a dblClick event to allow the users to change the caption. This is working fine-&-all, but I'm wondering if there's a way for me to improve my code. Is there a way to be able to avoid making dozens of copies of the same code just to handle the same event on different objects? Here is my code: Private Sub Item1_Label_dblClick(ByVal Cancel as MSForms

Listbox Error “ Could not Set the List property. Invalid Property Value.”

北战南征 提交于 2019-12-13 04:05:35
问题 I have userform with a Listbox, textbox and comboboxes and a Save button. Below is my save button code. Private Sub cmdsave_Click() Dim x As Integer x = Me.ListBox1.ListCount If Me.cmbtrans.Value = "Debit" Then With Me.ListBox1 .Enabled = True .ColumnCount = 13 .ColumnWidths = "49.95 pt;10 pt;114.95 pt;10 pt;114.95 pt;10 pt;114.95 pt;10 pt;75 pt;10 pt;49.95 pt;10 pt;49.95 pt" .AddItem .List(x, 0) = Me.txtdate .List(x, 1) = "|" .List(x, 2) = Me.txtgrouphead .List(x, 3) = "|" .List(x, 4) = Me

getting an a error when I try to populate text boxes based on combo box selection

限于喜欢 提交于 2019-12-13 02:50:31
问题 Trying to get text boxes to populate when a name is selected from my combo box (cboCo). Getting the error method range of object'_worksheet' failed on fourth line of code. I am not a strong programmer and VB has always been a struggle for me. I am working on creating a form for a vendor spreadsheet that will allow users to view data in the spreadsheet, edit vendor data, add new data and delete data as needed. I so far have got it to add data and show the company names in the combo box. What I

Userform.Show on a form button will not recognize userform, getting Error 424

ぐ巨炮叔叔 提交于 2019-12-13 02:18:17
问题 I know very little about VBA, but I'm trying to design a userform for an excel workbook. The idea is click the button, bring up the userform, enter info, hit OK, and your info is formatted correctly and inserted into the worksheet. I have 3 userforms that all work fine, but any macro I create that references one of them just does not recognize that that particular userform exists. The code I'm having a problem with is pretty straightforward: Private Sub LiquidFormButton_Click()

VBA USERFORM: PREVENT COMBOBOX ESCAPE ON KEYDOWN

大城市里の小女人 提交于 2019-12-12 16:52:14
问题 Community, There is a way to prevent an active combobox from losing its focus when hitting the down arrow (or up arrow) when at the end (or start) of a list. If there is a better way to do this (preferably with an MS standard property) please share. Problem: When at the end of a list in a ComboBox, if you hit the down arrow it will move you to whatever control is physically below the active combobox. Vice versa for being at the top of a combobox and hitting the up arrow. This is sloppy and