Thread: Help with macro
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MichaelRobert MichaelRobert is offline
external usenet poster
 
Posts: 64
Default Help with macro (II)

The 'offset' command works fine, but i am having difficulty embedding it into
the "Paste Special values" macro which I recorder earlier. There is
something I am not getting about specifying the destination range.

Here is the code that I want to modify so that the destination range is the
'offset' range rather than "A20":

Sub PasteSpecial()
Range("A4:E4").Select
Application.CutCopyMode = False
Selection.Copy
Range("A20").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

Thanks again.

Mike

"MichaelRobert" wrote:

Many thanks, 'Gary's student' and Rick.

Mike

"Rick Rothstein" wrote:

You can shorten your macro a bit...

Sub Mike()
Range("F7:M7").Copy Cells(Rows.Count, "F").End(xlUp).Offset(1)
End Sub

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
Try this:

Sub michael()
Dim r As Range, r2 As Range
Set r = Range("F7:M7")
n = Cells(Rows.Count, "F").End(xlUp).Row + 1
Set r2 = Range("F" & n)
r.Copy r2
End Sub
--
Gary''s Student - gsnu200814