Hello, I want to write a macro on excel which makes the below
job:
I will have 2 variables let say a and b. Then , I want to copy
the rows between "row a" and "row b". That is all. I made such an
code,
dim a as integer
dim b as integer
Rows(XXXXXXXXX).Select
Selection.Copy
I cant fill the inside of the Rows( ) function. What is the
suitable way of writing this function? Is there a way? If not, how can
I do this job .Thanks alot.
Don Guillett - 21 Mar 2006 21:08 GMT
will this do it?
sub copyrows
rows(1).copy rows(2)
end sub

Signature
Don Guillett
SalesAid Software
dguillett1@austin.rr.com
> Hello, I want to write a macro on excel which makes the below
> job:
[quoted text clipped - 10 lines]
> suitable way of writing this function? Is there a way? If not, how can
> I do this job .Thanks alot.
Chip Pearson - 21 Mar 2006 21:12 GMT
Rows(a & ":" & b).Select

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
> Hello, I want to write a macro on excel which makes the
> below
[quoted text clipped - 14 lines]
> how can
> I do this job .Thanks alot.
Carim - 21 Mar 2006 21:22 GMT
Hi Oercim,
If I understand correctly your request :
Sub Macro1()
Dim a As Integer
Dim b As Integer
a = 6
b = 12
Rows(a & ":" & a).Copy
Rows(b & ":" & b).Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveCell.Select
End Sub
HTH
Cheers
Carim
oercim - 21 Mar 2006 21:38 GMT
Thanks for help, below code makes the job,
Sub Macro1()
Dim a As Integer
Dim b As Integer
a = 6
b = 12
Rows(a & ":" & b).Select
Selection.Copy
End Sub
Again thanks alot.Cheers