How to macro to relative position
Not quite.
I need the macro to copy and paste A(X) from Sheet1 to $A$1 of Sheet2 based
on the row position of A(X).
So if I click the button on row 1 on sheet 1 then it will pasts the value of
A1 sheet1 on Sheet2 $A$1. If I click the button on row2 on sheet 1 then it
will paste the value of A2 sheet1 on Sheet2 $A$1
Any suggestions
"JE McGimpsey" wrote:
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?
|