Académique Documents
Professionnel Documents
Culture Documents
Page 1 of 8
To specify in VBA where the cursor is, use:
ActiveCell
Followed by the dot operator and then the
method that we want to use, such as:
ActiveCell.Copy
If we want to specify a starting location that is
not where the cursor is, then:
Range("C10").Select To select that cell
Range("C10").Copy To copy that cell
3
Page 2 of 8
To select a one-cell range, add Select,
5
ActiveCell.Resize(1,1).Select ActiveCell. Select
Page 3 of 8
Within the same worksheet
To another worksheet
Page 4 of 8
Selecting a range from another location
Selecting three whole columns D, E, F from the
starting cell of Cell A1
10
Page 5 of 8
To get the address of the location of the cell we
were looking for, change the Activate to
Address
Also declare a variable to hold the address value,
11
12
Page 6 of 8
Every worksheet is allocated memory based on
its contents
If we have used no more than a 10 row by 10
column area for our work, and have not touched
any of the other cells, the "last cell" in that
worksheet would be Cell J10
We can locate this and also determine the VBA macro
for it by recording the macro as we press Ctrl+End
13
14
Page 7 of 8
To duplicate the action of selecting multiple
sheets in Excel, i.e., the equivalent of clicking
on individual tabs while pressing on the Shift
key.
eg. Selecting the sheets between Worksheet(1),
the leftmost tab, and Worksheet(5), the fifth sheet
from the left.
15
16
Page 8 of 8