how to copy the first row to a new page?

H

hans

I use the following macro:

Sheets("Inschrijvingen").Select
Rows("1:1").Select
Selection.Copy
Range("a1").Select
ActiveCell.Offset(1, 0).Select
inschrijfnummer = Range("a2").Value
Do While Not IsEmpty(ActiveCell)
If ActiveCell.Offset(0, 13).Value = "Nee" Or ActiveCell.Offset(0,
13).Value = "N" Then
If Not SheetExists("Melden landelijke dd " & Date) Then
Worksheets.Add.Move After:=Worksheets(Worksheets.Count)
Set CurSheet = ActiveSheet
CurSheet.Name = "Melden landelijke dd " & Date
Range("A1").Select *************
ActiveSheet.Paste *************
End If
ActiveCell.Offset(1, 0).Select
Loop

I get an error on the line wirh the **********
What am i doing wrong?

Greetings Hans
 
O

Orlando Magalhães Filho

Hi Hans,

It's not easy mount a workbook to verifi your code, but try this:


Sheets("Inschrijvingen").Select
Range("a1").Select
ActiveCell.Offset(1, 0).Select
inschrijfnummer = Range("a2").Value
Do While Not IsEmpty(ActiveCell)
If ActiveCell.Offset(0, 13).Value = "Nee" Or ActiveCell.Offset(0,
13).Value = "N" Then
If Not SheetExists("Melden landelijke dd " & Date) Then
Worksheets.Add.Move After:=Worksheets(Worksheets.Count)
Set CurSheet = ActiveSheet
CurSheet.Name = "Melden landelijke dd " & Date

Sheets("Inschrijvingen").Select
Rows("1:1").Select
Selection.Copy
CurSheet.Select

Range("A1").Select *************
ActiveSheet.Paste *************
End If
ActiveCell.Offset(1, 0).Select
Loop


HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top