Thank you RoyUk. I believe you are right, and ListBox will be easiest to illustrate the necessary information.
Posts by dwlott
-
-
I setup my buttons to fit into cells, then tried using intersect method to delete the same shapes, yet some shapes remained. My solution was to name my shapes with the column and row in the shape names, then when I wanted to delete the shapes, loop through all shapes, deleting the shapes per the text in the shape names.
Code
Display More'This code deletes shapes based on text in the shape names that identifies row and column. Sub DeleteShapesInColumn2() Dim shp As shape Dim sh As Worksheet `'Loop through all the shapes on the sheet, delete all with Col02 in shape name Set sh = ThisWorkbook.Worksheets("mySheet") If sh.Shapes.Count > 0 Then For Each shp In sh.Shapes If InStr(shp.Name, "Col02") Then shp.delete End If Next shp End If End Sub
-
If you change the caption in your code it will change the UserForm caption whilst the UserForm is displayed. It will not change the UserForm's Caption Property andwhen the userForm is closed the Caption will be UserForm1.
Likewise, the TextBox will only contain the text from the macro until the userform is closed.
Thank you royUK, that is the solution. And thanks for the new user tips. I can tag my code here now!
If someone can help me further, the form I want to create will look like this, listing the files to be written to and the items to be written:
Can a TextBox output be formatted to look like this?
FileName1
Item1, Item2, Item3 ...
FileName 2
Item1, Item2 ...
FileName3
Item1, Item2, Item3, Item4 ...
ect...
Am I going about this the right way; using the Textbox? Can the TextBox.Text property hold a very long string and be formatted to look like the above example? The string will be long enough to need scrollbars and I'll have the "proceed" and "Cancel" buttons at the top of the form.
-
I want to create a custom messagebox that will display a list of files that will be written to, and what will be written to them. I want two buttons at the top, proceed and cancel. I'm not sure I'm going about this the right way. I'm imagining a Userform with two textboxes and two buttons. Wading into this venture, I got stuck right away and spent a day on the web trying to figure it out. Please help.
In vba, I create a Userform from the menu with <Insert> <Userform>. This is the first Userform so it's default name is "Userform1". It's caption name also defaults to "Userform1". I try to change the caption using Userform1.Caption = "New Caption". The code runs, but nothing changes in the Properties panel.
I add a Textbox to the userform. I want to add some text to the Textbox so I try Userform1.Textbox1.Text = "New Text". I also try "Userform1.Textbox1.Value = "New Text". The code runs, nothing changes in the Properties panel. I thought this would be cake. What am I missing?
CodeSub testingUserform() UserForm1.Caption = "New Caption" UserForm1.TextBox1.Text = "New Text" End Sub
I'm currently running excel from microsoft office 360.