how to copy the first row to a new page?

  • Thread starter Thread starter hans
  • Start date Start date
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
 
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
 
Back
Top