Some Working Notes:
- Remember to always save file when using : Excel Macro -Enabled Template so that you do not lose saved data.
- To use macro you need to have design mode on.
- To create the run button you need to do it after selecting design mode to use insert and then select the coding box.
- To use macro you need to have design mode on.
- To create the run button you need to do it after selecting design mode to use insert and then select the coding box.
Using Macro
1- To record working steps you need to have design mode on.
2- Then you need to select record macro, then you can do your required steps, after you assign a name for the process.
3- Then you press on macros.
4- Then you to the selected name and press edit.
2- Then you need to select record macro, then you can do your required steps, after you assign a name for the process.
3- Then you press on macros.
4- Then you to the selected name and press edit.
Sample Code 1
Private Sub CommandButton1_Click()
Cells(1, "A") = "temp"
Cells(2, "A") = "temp"
Cells(3, "A") = "temp"
Cells(4, "A") = "temp"
Cells(5, "A") = "temp"
Cells(6, "A") = "temp"
Cells(7, "A") = "temp"
Cells(8, "A") = "temp"
Cells(9, "A") = "temp"
Cells(10, "A") = "temp"
ActiveCell.FormulaR1C1 = "=RAND()"
Range("A11").Select
Range("A12").Select
End Sub
Cells(1, "A") = "temp"
Cells(2, "A") = "temp"
Cells(3, "A") = "temp"
Cells(4, "A") = "temp"
Cells(5, "A") = "temp"
Cells(6, "A") = "temp"
Cells(7, "A") = "temp"
Cells(8, "A") = "temp"
Cells(9, "A") = "temp"
Cells(10, "A") = "temp"
ActiveCell.FormulaR1C1 = "=RAND()"
Range("A11").Select
Range("A12").Select
End Sub
Sample Code 2
Private Sub zift_Click()
Cells(1, "A") = "x"
Cells(1, "B") = "y"
Cells(1, "C") = "i"
C = Cells(2, "C")
For i = 2 To C
x1 = Cells(i, "A")
y1 = 2 * x1
ActiveCell.FormulaR1C1 = "=RAND()"
Range("D17").Select
Cells(i, "B") = y1
Next i
End Sub
Cells(1, "A") = "x"
Cells(1, "B") = "y"
Cells(1, "C") = "i"
C = Cells(2, "C")
For i = 2 To C
x1 = Cells(i, "A")
y1 = 2 * x1
ActiveCell.FormulaR1C1 = "=RAND()"
Range("D17").Select
Cells(i, "B") = y1
Next i
End Sub
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2024 - http://cfd2012.com