Clear and good explanation but concern is you are getting into details. like you should also explain why you use Dim? string? and etc. when to use why to use and where to use etc etc. So fresher/new user will understand the purpose those terms
Great tutorial. Super informative and elaborate, yet simple. I like the simplicity in the languages you write. It is veeeery helpful to dummies like myself. I'm following you, sir. Blessings from above!!!
Can u help with : when u click on a shape , the graph is displayed on the same sheet. I have 5 teams and I have created graphs showing absence for 2 yrs. I gave created a dashboard without having to show entire data. I made shapes with each team name. Now when I click on the specific team button. Their chart displays on the dashboard sheet. Unlike hyperlink that takes u to a diff sheet..Plz help
How can we feed this details in our excel instead of msgbox.?? I have try this by using array,loops but it's not working pls explain the Correct method.??
Good Question Anamika.. I have done it without using array... Declare irow as variable and Long as Variable Type Then use irow = Sheet1.Range("B" & Rows.Count).End(xlUp).Row + 1 Kindly reply if you need entire code but first its good to try :)
What code should we write to select a radio button by default? For an e.g. I have to select Gender as Male or Female. 99% chances I am selecting Male. So I want Male should be selected by default. As and when I have to select Female, I do that manually. Please let me know the code for default selection of a particular radio button. Thanks in advance
Private Sub CommandButton1_Click() Dim ans As String If qns_ans.OptionButton1.Value = True Then ans = "Bus" ElseIf qns_ans.OptionButton2.Value = True Then ans = "Train" ElseIf qns_ans.OptionButton3.Value = True Then ans = "Flight" ElseIf qns_ans.OptionButton4.Value = True Then ans = "Car" Else ans = "No option selected " End If If ans = "No option selected " Then MsgBox "You have not selected any option" Else MsgBox "You have selected " & ans End If End Sub
Private Sub CommandButton1_Click() Dim Ans As String If UserForm2.OptionButton1.Value = True Then Ans = "Bus" ElseIf UserForm2.OptionButton3.Value = True Then Ans = "Car" ElseIf UserForm2.OptionButton2.Value = True Then Ans = "Flight" ElseIf UserForm2.OptionButton4.Value = True Then Ans = "Train" Else MsgBox "Choose your Option" Exit Sub End If MsgBox "You have selected " & Ans End Sub
Dim (dimension of data) indicates you are about to declare a variable of a certain type, to be used in a Sub routine. There are different types of variabes. Here I use the integer, string, short and date type variables, but there are other types. This 'Dim varName Type' is simply to let the application know what type of data to expect and work with. For example: Private Sub Dim varName as integer, Dim varAddress as string, Dim varCity as string, Dim varZip as short, Dim varToday as Date. After you declare (Dim) your variables, then comes your code. In your code you use the var#### you created, to hold the type data for which they were choose. The subrouting end with End Sub. Note, when declaring variables, you can put each on a sepearte line that start with Dim... or you can use "Dim" just once and line up all the variables & their type behind it, sepearted by commas. Do this, in VB Editor code window, write (line 1) Dim txtName as String (Line 2) Private Sub ShowName(), (line 3) txtName = "your name", (line 4) msgbox txtName, (line5) End Sub. Run the program with the little green arrow and see how it used the variable txtName, to store you name (txtName = “your name”, then output it to the screen using a msgbox; or you could have used a label to do the output. Change the textbox value (your name), will change the output. Imagine if you were trying to change “your name” that appeared in 1000 places. Wouldn’t it be easier to simply do (txtName = “another name”), than to have to go to 1000 lines and change it manually! Of course, you will need to enter the txtName variable in each of the 1000 places where your name or another name will appear. But whenever you make a change, you only make it in one place. Good Luck
Get Certified in Excel VBA:bit.ly/41fWeVP
Use coupon "RUclips12" to get ‘’FLAT 12%’’ OFF at Checkout.
Clear and good explanation but concern is you are getting into details. like you should also explain why you use Dim? string? and etc. when to use why to use and where to use etc etc. So fresher/new user will understand the purpose those terms
Great tutorial. Super informative and elaborate, yet simple. I like the simplicity in the languages you write. It is veeeery helpful to dummies like myself. I'm following you, sir.
Blessings from above!!!
Learned a lot from you .. Thank You very much
Thanks! Thanks! Thanks!🙂
Thank you so much sir I have learned so many macros
Super!
Very good presentation.
I am from Nepal and much interested in your tutorials!
Excelentes aulas. Deus abençoe.
Thank you very much.
Write else: answer="None"
End if
Msgbox "You have selected" &" "& answer
(Now on execution of the said code, proper messages will be displayed.)
Thanks
Can u help with : when u click on a shape , the graph is displayed on the same sheet. I have 5 teams and I have created graphs showing absence for 2 yrs. I gave created a dashboard without having to show entire data. I made shapes with each team name. Now when I click on the specific team button. Their chart displays on the dashboard sheet. Unlike hyperlink that takes u to a diff sheet..Plz help
how to run macro in sheet1 by pressing button in sheet2 in same ecxel file
How can we feed this details in our excel instead of msgbox.?? I have try this by using array,loops but it's not working pls explain the Correct method.??
Good Question Anamika..
I have done it without using array...
Declare irow as variable and Long as Variable Type
Then use
irow = Sheet1.Range("B" & Rows.Count).End(xlUp).Row + 1
Kindly reply if you need entire code but first its good to try :)
thank you sir
Sir mine is showing compile eror- method or data member not found
If I want to leave it blank or don't want to choose an option, do it take a way else answer = choose an option. Thank
🔘
What code should we write to select a radio button by default? For an e.g. I have to select Gender as Male or Female. 99% chances I am selecting Male. So I want Male should be selected by default. As and when I have to select Female, I do that manually.
Please let me know the code for default selection of a particular radio button.
Thanks in advance
If we select two radio button at same time and click on submit what will happen???
Hello, may I ask how to fix the issue with no selection 4:20.
Thank you!
Private Sub CommandButton1_Click()
Dim ans As String
If qns_ans.OptionButton1.Value = True Then
ans = "Bus"
ElseIf qns_ans.OptionButton2.Value = True Then
ans = "Train"
ElseIf qns_ans.OptionButton3.Value = True Then
ans = "Flight"
ElseIf qns_ans.OptionButton4.Value = True Then
ans = "Car"
Else
ans = "No option selected "
End If
If ans = "No option selected " Then
MsgBox "You have not selected any option"
Else
MsgBox "You have selected " & ans
End If
End Sub
Private Sub CommandButton1_Click()
Dim Ans As String
If UserForm2.OptionButton1.Value = True Then
Ans = "Bus"
ElseIf UserForm2.OptionButton3.Value = True Then
Ans = "Car"
ElseIf UserForm2.OptionButton2.Value = True Then
Ans = "Flight"
ElseIf UserForm2.OptionButton4.Value = True Then
Ans = "Train"
Else
MsgBox "Choose your Option"
Exit Sub
End If
MsgBox "You have selected " & Ans
End Sub
Sir, could you please explain about "Dim" in the macro... I didn't understood "Dim"... what is Dim and what is the usage of "Dim"....
Dim (dimension of data) indicates you are about to declare a variable of a certain type, to be used in a Sub routine. There are different types of variabes. Here I use the integer, string, short and date type variables, but there are other types. This 'Dim varName Type' is simply to let the application know what type of data to expect and work with. For example: Private Sub Dim varName as integer, Dim varAddress as string, Dim varCity as string, Dim varZip as short, Dim varToday as Date. After you declare (Dim) your variables, then comes your code. In your code you use the var#### you created, to hold the type data for which they were choose. The subrouting end with End Sub. Note, when declaring variables, you can put each on a sepearte line that start with Dim... or you can use "Dim" just once and line up all the variables & their type behind it, sepearted by commas. Do this, in VB Editor code window, write (line 1) Dim txtName as String (Line 2) Private Sub ShowName(), (line 3) txtName = "your name", (line 4) msgbox txtName, (line5) End Sub. Run the program with the little green arrow and see how it used the variable txtName, to store you name (txtName = “your name”, then output it to the screen using a msgbox; or you could have used a label to do the output. Change the textbox value (your name), will change the output. Imagine if you were trying to change “your name” that appeared in 1000 places. Wouldn’t it be easier to simply do (txtName = “another name”), than to have to go to 1000 lines and change it manually! Of course, you will need to enter the txtName variable in each of the 1000 places where your name or another name will appear. But whenever you make a change, you only make it in one place. Good Luck
Nice
What's solution for giving undesirable message if we do not select any option?
But how do you clear selections?
dear sir,
please give Excek VBA pdf book list link
hello sir, how to conduct quiz using vba userform??
How to use 4 or 6 option buttons in VBA. Because only one election is made
Vba
sir ye aap video banate kaise ho