Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Move 2 cells to right
hi,
Please help. In excel vba, what is the command to move the cursor. Example: The cursor was in one cell and i want move it 2 cells to the left. Thanks in advance. |
#2
|
|||
|
|||
Move 2 cells to right
Activecell.Offset(0,2).Select
-- HTH RP (remove nothere from the email address if mailing direct) "Pasmatos" wrote in message ... hi, Please help. In excel vba, what is the command to move the cursor. Example: The cursor was in one cell and i want move it 2 cells to the left. Thanks in advance. |
#3
|
|||
|
|||
Move 2 cells to right
Sub Macro1()
Dim i As Long Dim j As Long j = Selection.Column i = Selection.Row Cells(i, j + 2).Select End Sub to move to an arbitrary place use Cells(I+9,J+13).Select for example -- Gary's Student "Pasmatos" wrote: hi, Please help. In excel vba, what is the command to move the cursor. Example: The cursor was in one cell and i want move it 2 cells to the left. Thanks in advance. |
#4
|
|||
|
|||
Move 2 cells to right
You rarely need to select a cell or range of cells in VBA. Code is cleaner
and works FAR faster if you do not select cells. To answer you question, though activecell.offset(0,-2).select Now, if you are selecting it because you want to copy it, or clear it, etc, do this instead activecell.offset(0,-2).copy activecell.offset(0,-2).clear activecell.offset(0,-2).pastespecial xlPasteAll "Pasmatos" wrote: hi, Please help. In excel vba, what is the command to move the cursor. Example: The cursor was in one cell and i want move it 2 cells to the left. Thanks in advance. |
#5
|
|||
|
|||
Move 2 cells to right
Hi!
Thanks to all for your help about. Regards. Paulo "Pasmatos" wrote: hi, Please help. In excel vba, what is the command to move the cursor. Example: The cursor was in one cell and i want move it 2 cells to the left. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I automatically move vertical cells horizontally? | New Users to Excel | |||
Display first, second, etc Nonblank Cells in a Range | Excel Worksheet Functions | |||
Use functions when cells are merged | Excel Worksheet Functions | |||
Counting only active cells | Excel Discussion (Misc queries) | |||
To safety merge cells without data destroyed, and smart unmerge! | Excel Discussion (Misc queries) |