View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
stevebriz stevebriz is offline
external usenet poster
 
Posts: 195
Default VBA compy base on range

Ed,
I am little unsure what you are trying to do here?
Do you want to look at the values in A1 and A2 and then subtract A1
value from A2 to give you the number of rows you want to copy.
Where do you want to copy these 10 rows from eg: what row do you want
to start with eg:
do you want copy the 10 rows from the row number of the A1 value and
then down for the next (A2-A1) rows? or something else?
sorry if this is little confusing ...but I am just trying to work out
what you are trying to achieve here.


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