View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default difficult question

try this from anywhere in the workbook
Sub copyslectedrows()
R = InputBox("pls input the first row number")
R1 = InputBox("pls input the last row number")
With Sheets("sheet2")
lr = .Cells(Rows.Count, "a").End(xlUp).Row+1
sheets("source").Rows(R & ":" & R1).Copy .Rows(lr)
End With
End Sub


--
Don Guillett
SalesAid Software

"Wu" wrote in message
...
I want to write a marco that to copy few specified rows from sheet 1 to
sheet
2:
.................................................. .................................................. ...
R=Inputbox("pls input the first row number")
R1=inputbox("pls input the last row number")

Rows(R:R1).Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste

.................................................. .................................................. .....

But, the above macro is not work at "Rows(R:R1).Select", I would like to
use
inputbox to enter specified number of row to copy from sheet1 to sheet2.
How
to do that???