View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Copy cells and paste to an address given in another cell (VBANewbie)

Hi Rob

Try:

Sub CopyIt()
Dim CTo As Range
Dim CRng As String
CRng = Sheets("Entry Sheet").Range("B20").Value
Set CTo = Sheets(Left(CRng, InStr(1, CRng, "!") - 1)). _
Range(Right(CRng, Len(CRng) - InStr(1, CRng, "!")))
Sheets("Entry Sheet").Range("B27:B33").Copy
CTo.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub

Regards
Rowan

WightRob wrote:
As I said in my last post, the problem was solved. Unfortunately that
was only with my simplfied example.

In my actual workbook, the values in the range B27:B33 are fed in from
a calculator sheet. Rowan's code is copying the actual cell data,
which is now setting up a link to the calculator sheet. What I need is
a "Paste Special" = Value, rather that a simple "Paste", is this
possible?

I am new to VBA coding, so all help is appreciated.

Rob