Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default copying rows between a and b

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default copying rows between a and b

Rows(a & ":" & b).Select


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"oercim" wrote in message
ups.com...
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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default copying rows between a and b

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default copying rows between a and b

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying & Inserting Rows w/o Affecting other Rows Etc. LRay67 Excel Worksheet Functions 1 October 22nd 08 02:10 AM
Copying multiple rows to other worksheets (but amount of rows varies) - How? David Smithz Excel Discussion (Misc queries) 1 June 18th 06 04:31 PM
Copying Rows Dthmtlgod New Users to Excel 3 November 4th 05 05:50 AM
Copying Rows when hiding other rows Neutron1871 Excel Worksheet Functions 2 November 3rd 04 11:38 PM
copying rows monica Excel Programming 1 September 10th 04 09:59 AM


All times are GMT +1. The time now is 10:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"