Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pasting Data using an address in a Cell 1

Status
Not open for further replies.
Jun 5, 2002
417
AU
Hi,

I need some help pasting data to a different location/sheet in a workbook. (Actually I want to do several of these.)

I have setup the location address in a cell - "N2" on the sheet where the macro would be initiated, namely "INPUT". N2 will contain an address such as: 'XYZ'!B74

The current code is:

Range("Result").Copy '(Where Result is the range to be copied from)

Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

What code do I use to replace "Selection" with so that each PasteSpecial will occur where I want it - at the address indicated in cell N2?

Thanks in anticipation.

Peter Moran
 
What about this ?
Code:
Range("Result").Copy
With Range([N2])
  .PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
                False, Transpose:=False
  .PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
                False, Transpose:=False
End With

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,

Spot on!

Have a Star!

I seem to have trouble finding the coding rules to do what I know can be done.

Many thanks.

Peter Moran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top