Private Sub Userform Activate

👉🏻👉🏻👉🏻 ALL INFORMATION CLICK HERE 👈🏻👈🏻👈🏻
5) напишите код процедуры для обработки события Initialize формы, которое происходит, когда форма инициализируется. Процедура заполняет поле со спискомComboBox1. Добавьте в поле со списком 4 города.
6) напишите код процедуры для обработки события Click элемента "Кнопка" с именем CommandButtonl. Предусмотрите в макросе обработку следующих ситуаций:
MsgBox "Вы не ввели фамилию": Exit Sub
б) если не выбрана в списке должность или не указан город. Свойство ListIndex содержит порядковый номер выбранной в списке строки. Строки в списке нумеруются, начиная с 0. Если не выбрана ни одна строка, свойство ListIndex имеет значение -1.
MsgBox "Вы забыли выбрать должность": Exit Sub
7) для определения того, какое значение было выбрано из списка ListBox1 воспользуйтесь оператором выбора:
8) занесите введенное в поле TextBox1, выбранное из списка ListBox1 и из поля со списком ComboBox1 значения в список ListBox2 с помощью метода AddItem.
9) для удаления выбранного пункта из списка используется метод RemoveItem Index. Параметр index указывает на порядковый номер удаляемого пункта и является обязательным.
Предусмотрите ситуацию, когда не отмечена строка в списке при удалении.
Измените форму и напишите процедуры для решения задачи согласно варианту:
Понравился сайт? Поделись им с друзьями:
and other VB enthusiasts, i need your help.
i'm using visual basic 6.3 : Excel>Tools>macro>Visual basic Editor
i'm creating a user interface. However i have trouble putting my ideas into codes.
When i run my program, i want it to Prompt the user for its name.
theName typed will display at the top-left of the program. [ i think using label right? ] if the person click on enter without typing anything, i want it to show error msg.
and saving the file as "theName".xls if there's another file of the same name, i dont want it replaced. eg. [ theName1.xls ]
i understand it got to do with this?
Private Sub UserForm_Activate()
I'm pretty clueless now.
Please assist me. I'll be deeply appreciated.
Yes.i developing this for patients going for hand Rehabilitation.
Once i'm familiar with this programming lang, i'll contribute to the Forum
Last edited by discCPU; Apr 4th, 2007 at 03:10 AM.
returnstring=InputBox("Enter your name")
returnstring="" msgbox ="Please enter your name"
returnstring=InputBox("Enter your name")
returnstring=InputBox("Enter your name")
returnstring=InputBox("Enter your name")
returnstring=InputBox("Enter your name")
Since this is Excel VBA code I will move the thread to our Office Development forum. Also, Welcome to the Forums.
Moved
Where are you doing the save from?
Ps, there is no "Form_Load" event in VBA.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
oh VBA. ok. i'll take note of it. thanks for the welcome RobDog888.
i like this forum. fast response with members of vast knowledge of VB.
i hope i'll be like them one day.
i'll be trying out the code macka007.
how abt saving the file?
You mean to programmatically save the file and prompt if it already exists?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Open "C:\Example.txt" for output as #1 'create a txt file, or if one exist, overwrite it
print #1, "This is a test!" 'Write this out to the text file
print #1, "it is very simple to save data to txt files" 'Write out more data
Dim InputString as String 'make a variable which is a string
Open "C:\Example.txt" for input as #1 'Open the file, note we are inputing it
do while not eof(1) 'eof stands for end of file, we will continue the loop until we reach the last line of the file
InputString= line input #1 'input one line and store in the variable
msgbox inputstring 'change this to whatever you want to do with the data
loop 'go to the beggining of the loop
Last edited by Macka007; Apr 4th, 2007 at 04:08 AM.
Text file? I thought this was an xls file?
If so, then here is how:
ThisWorkbook.SaveAs Filename:="C:\SomeFile.xls", FileFormat:=xlExcel8
It will automatically prompt for overwrite aceptance if the file already exists.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Text file? I thought this was an xls file?
If so, then here is how:
ThisWorkbook.SaveAs Filename:="C:\SomeFile.xls", FileFormat:=xlExcel8
It will automatically prompt for overwrite aceptance if the file already exists.
'Create some different file name.
ThisWorkbook.SaveAs FileName:="C:\SomeFolder\MyFile_" & Format(Now,"YYYYMMDD_HhNnSs") & ".xls", FileFormat:=xlExcel8
'Save but as what? Atutomatically give it a default file and path or prompt them for it?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
'Create some different file name.
ThisWorkbook.SaveAs FileName:="C:\SomeFolder\MyFile_" & Format(Now,"YYYYMMDD_HhNnSs") & ".xls", FileFormat:=xlExcel8
'Save but as what? Atutomatically give it a default file and path or prompt them for it?
filename = Split(CStr(Date), "/")(0) + Split(CStr(Date), "/")(1) + Split(CStr(Date), "/")(2)
' to auto save the data recorded in excel after pressing stop
Open "C:\" + filename + ".txt" For Output As #1
For q = 1 To CInt(TextBox3.Text)
Print #1, CStr(ActiveSheet.Cells(q, 1)) + "," + CStr(ActiveSheet.Cells(q, 2)) & vbCrLf
AskAgain: ReturnString = InputBox("Enter your name")
Last edited by discCPU; Apr 4th, 2007 at 09:55 PM.
Its was just for the formatting of the filename mostly. Adding a .GetSaveAsDialog function wil be what you want to create a Save As dialog.
The other code is just writting out a textfile (of comma separated values) of some range of cells with a date format. But if they save twice within one day it will be duplicated.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Its was just for the formatting of the filename mostly. Adding a .GetSaveAsDialog function wil be what you want to create a Save As dialog.
The other code is just writting out a textfile (of comma separated values) of some range of cells with a date format. But if they save twice within one day it will be duplicated.
strTest = Application.GetSaveAsFilename(InitialFileName:="Test.xls", FileFilter:="Excel Workbooks (*.xls), *.xls", FilterIndex:="1", Title:="My Dialog")
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
strTest = Application.GetSaveAsFilename(InitialFileName:="Test.xls", FileFilter:="Excel Workbooks (*.xls), *.xls", FilterIndex:="1", Title:="My Dialog")
ActiveSheet.Cells(i, j) = ""
ActiveSheet.Cells(1, 1) = "Ch1(uV)" 'name the cell as Ch1(uV)
ActiveSheet.Cells(1, 2) = "Ch2(Deg)"
UltimaSerial.Device = Val(List1.Text) 'Select the device
UltimaSerial.CommPort = Val(Combo1.Text) 'COM port
UltimaSerial.ChannelCount = 2 'enable only two channel
UltimaSerial.MaskOutDigitalBits = True 'Not allowing digital inputs to be embeded in analog channel
UltimaSerial.SampleRate = Val(TextBox1.Text)
UltimaSerial.AcquisitionMode = NoCondition 'trigger method
Label4.Caption = "Serial Number: " + UltimaSerial.SerialNumber ' display the serial number
UltimaSerial.Stop 'stop the program
IeTimer3.Enabled = False ' stop the IeTimer3
filename = Split(CStr(Date), "/")(0) + Split(CStr(Date), "/")(1) + Split(CStr(Date), "/")(2)
' to auto save the data recorded in excel after pressing stop
Open "C:\" + filename + ".txt" For Output As #1
For q = 1 To CInt(TextBox3.Text)
Print #1, CStr(ActiveSheet.Cells(q, 1)) + "," + CStr(ActiveSheet.Cells(q, 2)) & vbCrLf
Well you have a start button and a stop button. Where is it that the save as dialog box should be presented?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Just replace the code from #8 in your code witht he 3 lines of code I gave you.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
i replaced line 38 with the code you gave me.
the dialog came. gd
but no excel file was actually saved.
No, because you need to write the saveas code lik eI posted earlier. Post #11
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
i'm pretty confused. where to put that?
ok. The current code i have: I open the excel file[ that has my codes inside]
i run it, it records the value at the same file. [excel file]
so now i want to have Save As, allowing the User to save that same file but only with the readings where ever the User wants.
please be patient. thx for being tolerant.
Last edited by discCPU; Apr 5th, 2007 at 03:21 AM.
do you mean that when the xls is saved it also saves your logging code into the new file? and you want to prevent this so only the recorded data is saved?
The "GetSaveAsFilename" code will go whereever you want to have it saved. So if its after some process then it will go after that code. etc.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
do you mean that when the xls is saved it also saves your logging code into the new file? and you want to prevent this so only the recorded data is saved?
more like copying the cells from cells1 to 9999 on a separate file.
please anyone help.
and Rob please tell him how to insert that in. my codes inside that. please
Easiest way to determine how to code something in VBA is to record a macro and view the module generated code.
FAQ: Record a Macro
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
BB code is On
Smilies are On
[IMG] code is On
[VIDEO] code is On
HTML code is Off
Copyright 2021 TechnologyAdvice. All Rights Reserved.
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.
All times are GMT -5. The time now is 03:48 AM.
Junior Miss Nudist Pageant 2003
Ballbusting Feet Heels Ball Crushing
Porndead Crush Fetish
Xnxx Indonesia Anak Kecil
Uz Sekis Xnxx Com
Private Sub UserForm_Activate() — Студопедия.Нет
Private Sub UserForm_Activate() — Студопедия
About Private Sub UserForm_Activate()-VBForums
Private Sub UserForm_activate() — Студопедия.Нет
Activate, Deactivate events (Visual Basic for Applications ...
Excel Vba - Userform_Activate Не Запускается На Show
Excel VBA ユーザーフォームのActivateイベント アクティブになっ …
Utiliser les UserForm en VBA Excel - Developpez.com
UserForm CommandButton in Excel VBA - Explained with Examples
Private Sub Userform Activate

















































