View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] acampbell012@yahoo.com is offline
external usenet poster
 
Posts: 129
Default VBA compy base on range

If you wanted to copy from (example) A1 to row B10:

Cells(1, 1).Resize(MyRange, 2).copy

Ed Dror wrote:
Hi there,

I'm using Excel 2003 and
I created a Function
Function MyRange() As Integer

MyRange = Worksheets("Sheet1").Range("A1") -
Worksheets("Sheet1").Range("A2")
MsgBox ("The Range is: ") & MyRange
End Function

Now A1 = 30 and A2 = 20 so 30-20=10

Then I want to compy 10 rows base on this results

How do I call MyRange function with my new Sub

Thanks,
Ed Dror
Andrew Lauren