Good evening
I would like to replace the text RANGE(quot;B13quot;).select by a more dynamic way
of moving the cursor.
My intent was to tell Excel GO UP ONE ROW... What is the instruction I need
to put in the macro to say Move up / move down... Go right / go left
ThanksMacro1 Macro
' Macro recorded 4/27/2006 by Michel Khennafi
'
'
Application.Goto Reference:=quot;Record_xquot;
Selection.EntireRow.Insert
Sheets(quot;Summary Sheetquot;).Select
Range(quot;recordquot;).Select
Selection.Copy
Sheets(quot;Vacationquot;).Select
Application.Goto Reference:=quot;Record_xquot;
Range(quot;B13quot;).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Application.Goto Reference:=quot;recordquot;
Range(quot;F38quot;).Select
Application.CutCopyMode = False
Selection.ClearContents
Range(quot;G38quot;).Select
Selection.ClearContents
End SubLook at Offset(row offset, column offset)
Range(quot;B13quot;).Offset(-1,0) will refer to cell B12
or, if you just want to select the cell above the active cell
ActiveCell.Offset(-1,0)
you could also use
Range(quot;B13quot;)(0,1)
in this case B13 is assumed to be cell 1,1 therefore 0,1 refers to the cell
just above it, 1,2 refers to cell C13 and so on. It's similar to offset, but
offset would, of course, assume B13 is cell 0,0
or Cells(13 - 1, 2) would refer to B12.
or Range(quot;Bquot; amp; 13 - 1)
Also, see Chips site for referring to cells within ranges
www.cpearson.com/excel/cells.htm
quot;Michel Khennafiquot; wrote:
gt;
gt; Good evening
gt;
gt; I would like to replace the text RANGE(quot;B13quot;).select by a more dynamic way
gt; of moving the cursor.
gt;
gt; My intent was to tell Excel GO UP ONE ROW... What is the instruction I need
gt; to put in the macro to say Move up / move down... Go right / go left
gt;
gt; Thanks
gt;
gt;
gt; Macro1 Macro
gt; ' Macro recorded 4/27/2006 by Michel Khennafi
gt; '
gt;
gt; '
gt; Application.Goto Reference:=quot;Record_xquot;
gt; Selection.EntireRow.Insert
gt; Sheets(quot;Summary Sheetquot;).Select
gt; Range(quot;recordquot;).Select
gt; Selection.Copy
gt; Sheets(quot;Vacationquot;).Select
gt; Application.Goto Reference:=quot;Record_xquot;
gt; Range(quot;B13quot;).Select
gt; Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
gt; _
gt; False, Transpose:=False
gt; Application.Goto Reference:=quot;recordquot;
gt; Range(quot;F38quot;).Select
gt; Application.CutCopyMode = False
gt; Selection.ClearContents
gt; Range(quot;G38quot;).Select
gt; Selection.ClearContents
gt; End Sub
gt;
gt;
