How to macro to relative position
One way:
With ActiveCell
If .Parent.Name = "Input Sheet" Then
Sheet1.Range("A1").Value = .Parent.Cells(.Row, 1).Value
Sheet1.Range("C1").Value = .Parent.Cells(.Row, 2).Value
End If
End With
(Assuming Sheet2 = "Input Sheet" and Sheet1 = "Input View")
In article ,
jk9533 wrote:
Range("A2").Select
I linked this macro to a button on the same row. So if they push the button
on row 2 it should read A2. If they push the button on row3 then A3 and so
on and so on.
Any help you can provide is greatly appreciated.
"JE McGimpsey" wrote:
Hmm... *which* range select, and *how* relative?
In article ,
jk9533 wrote:
Sheet2.Select
Range("A2").Select
Selection.Copy
Sheet1.Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Input Sheet").Select
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Input View").Select
Range("C1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub
How to I get the range select to be relative?
|