Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

copying rows between a and b

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
oercim - 21 Mar 2006 20:52 GMT
      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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.