level3ninja
New Member
- Joined
- Feb 21, 2011
- Messages
- 14
Hi.
I'm using Excel 2010, Windows 7.
For the life of me I cannot understand the logic behind pasting using vba in excel.
Anyhow, I'm getting the above error on the following macro:
The following line is highlighted when I Debug:
"ActiveCell.PasteSpecial (PasteAsXLPasteType = xlPasteAll)"
I have tried numerous different methods of pasting, but there must be something I'm missing that will allow all manner of paste methods to be used after it's fixed.
Thanks for your time.
I'm using Excel 2010, Windows 7.
For the life of me I cannot understand the logic behind pasting using vba in excel.

Anyhow, I'm getting the above error on the following macro:
Code:
Sub Heading_Relining_Up()
Dim rownumber As Long
Dim rcount As Long
rownumber = 0
rcount = ThisWorkbook.Worksheets(1).UsedRange.Rows.Count
Do
Range("D1").Offset(rownumber).Select
If ActiveCell = "" Then
rcount = rcount + 1
Else
If ActiveCell.Offset(0, 1) = "H" Then
ActiveCell.Cut
ActiveCell.Offset(0, -1).Select
ActiveCell.PasteSpecial (PasteAsXLPasteType = xlPasteAll)
ActiveCell.Offset(0, 2).Cut
ActiveCell.Offset(0, 3).Select
ActiveCell.PasteSpecial (xlPasteValues)
rownumber = rownumber + 1
Else
rownumber = rownumber + 1
End If
End If
Loop Until rownumber = rcount
Range("A1").Select
ExitSub:
End Sub
The following line is highlighted when I Debug:
"ActiveCell.PasteSpecial (PasteAsXLPasteType = xlPasteAll)"
I have tried numerous different methods of pasting, but there must be something I'm missing that will allow all manner of paste methods to be used after it's fixed.
Thanks for your time.