it is about vba in excel

loay
loay used Ask the Experts™
on
hi all
i have excel workbook has 2 sheets in one of them there are a table its range from a1 to k20 i want to put a command button that copy the first row to the second sheet and leave the secomd rpw witjout copying it and copy the 3rd row and leave the fourth and copy the 5th and leave the 6th and soo one
please can u help me on it so i will be very thank full
loay
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
you could add these code into a button


Dim sht1 As String
Dim sht2 As String

sht1 = "Sheet1" 'name of the source sheet
sht2 = "Sheet2" 'name of the destination sheet

Sheets(sht2).Select
Range("A1").Select
Sheets(sht1).Select
Range("A1").Select


While ActiveCell.Value <> ""
    ActiveCell.EntireRow.Select
    Selection.Copy
    Sheets(sht2).Select
    ActiveCell.PasteSpecial xlPasteValues
    ActiveCell.Offset(1, 0).Select
    Sheets(sht1).Select
    ActiveCell.Offset(2, 0).Select
Wend



Author

Commented:
thanx alot manthanein  your code gave me the basic idea to what i want and i complete it thanx alot again
loay

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial