Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
copying rows between a and b
will this do it?
sub copyrows rows(1).copy rows(2) end sub -- Don Guillett SalesAid Software "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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying & Inserting Rows w/o Affecting other Rows Etc. | Excel Worksheet Functions | |||
Copying multiple rows to other worksheets (but amount of rows varies) - How? | Excel Discussion (Misc queries) | |||
Copying Rows | New Users to Excel | |||
Copying Rows when hiding other rows | Excel Worksheet Functions | |||
copying rows | Excel Programming |