Hello,
Using the code:
Sub Rotate_Rota()
' cn = cell number
' fc = first cell
' lc = last cell
Dim cn As Integer, fc As Integer, lc As Integer
cn = 1
Do
cn = cn + 1
If Cells(cn, 1).Value = "fc" Then
Do
cn = cn + 1
If Cells(cn, 1).Value <> "lc" Then
Cells(cn, 1).Copy Cells(cn, 17)
End If
Loop Until Cells(cn, 1).Value = "lc"
End If
Loop Until Cells(cn, 1).Value = "lc"
Range(Cells(fc + 1, 17), Cells(lc - 2, 17)).Copy Cells(fc + 2, 17)
End Sub
It strikes me a bit long winded but bear with me please, the object is take the name at the bottom of the list and place it at the top of the list. When I get to the last line in the code I get an error 1004 Application-defined or object-defined error.
What does this mean and is there a way around it?
The list can vary in length hence the need to define where it starts and ends. Is there an easier way to do this.
Many thanks in advance for any suggestions help.
Using the code:
Sub Rotate_Rota()
' cn = cell number
' fc = first cell
' lc = last cell
Dim cn As Integer, fc As Integer, lc As Integer
cn = 1
Do
cn = cn + 1
If Cells(cn, 1).Value = "fc" Then
Do
cn = cn + 1
If Cells(cn, 1).Value <> "lc" Then
Cells(cn, 1).Copy Cells(cn, 17)
End If
Loop Until Cells(cn, 1).Value = "lc"
End If
Loop Until Cells(cn, 1).Value = "lc"
Range(Cells(fc + 1, 17), Cells(lc - 2, 17)).Copy Cells(fc + 2, 17)
End Sub
It strikes me a bit long winded but bear with me please, the object is take the name at the bottom of the list and place it at the top of the list. When I get to the last line in the code I get an error 1004 Application-defined or object-defined error.
What does this mean and is there a way around it?
The list can vary in length hence the need to define where it starts and ends. Is there an easier way to do this.
Many thanks in advance for any suggestions help.