Several methods of input data in cells
Author: KLYan Source:
OfficeFans
This is a trial written VBA course Vbalesson1, I hope that you will give advice for future improvement.
Program Description: Several methods for input data in cells in cells: Public Sub Writes () 1-- 2 Method, the simplest in "[]" input cell name. 1 [A1] = 100 'In the A1 cell input 100.2 [A2: A4] = 10' in A2: A4 cell input 10.3-- 4 method, using RANGE (")," "input unit The name of the grid. 3 RANGE ("B1") = 200 'Enter 200.4 Range in the B1 cell ("C1: C3") = 300' At C1: C3 cell input 300.5-- 6 method, using Cells (Row, Column ), ROW is a cell line, and Column is the number of cells. 5 Cells (1, 4) = 400 'In the D1 cell input 400.6 RANGE (Cells (1, 5), Cells (5, 5)) = 50' At E1: E 5 cell input 50. End Sub
You click any cell, press the Selection button, then the selected cell will be entered "Test". Public Sub Selection1 () selection.value = "test" 'Enter text "test" in any cell you click. End Sub
"Watch the method of this program: Bold text is the procedure, and other fonts are explained. Press the shortcuts Alt F11 to see the program."
Attachment: vbalesson1