LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Select method of Range class failed

I have the following code:

Sub DirectorFormat()

Dim TSLastPFRow As Integer 'Tally Sheet
Dim TSPFTotal As Integer 'Tally Sheet PF
Dim ZeroRow As Long, i As Long

With Sheets("Tally Sheet")
.Cells.Copy
.Paste Destination:=Worksheets("DirectorCopy").Range("A1" )
End With

With Worksheets("DirectorCopy")
.Shapes("LazyEyeButton").Cut
For j = 1 To 64
.Shapes("Done! " & j).Cut
Next

.Columns("G:G").Delete
.Cells.Copy
.Cells.PasteSpecial Paste:=xlPasteValues,
Operation:=xlPasteSpecialOperationNone, _
SkipBlanks:=False, Transpose:=False

'Find the last PF
For i = 4 To Rows.Count Step 8
If Cells(i, "A").Value = 0 Then
ZeroRow = i
Exit For
End If
Next

TSLastPFRow = ZeroRow - 9
TSPFTotal = (Val(Replace(Cells(TSLastPFRow, 1).Value, "_PF", "")))

'Delete empty PFs at the bottom
.Range(ZeroRow & ":515").Delete

'Delete all title bars except the first one
For i = (ZeroRow - 7) To 13 Step -8
.Rows(i).Delete
Next

'Move the last title bar up 2 rows
.Rows(5).Select
Selection.Cut
.Rows(3).Select
Selection.Insert Shift:=xlDown

.Rows(4).Select
ActiveWindow.FreezePanes = True
End With
End Sub

At .Rows(5).Select I keep getting error Select method of Range class failed.
I read the help file and I think I have the format right. Is .Select
causing the issue? How do I select that row otherwise?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Method of Range Class Failed [email protected] Excel Programming 4 June 21st 07 03:07 PM
Select method of range class failed sa02000[_4_] Excel Programming 1 October 5th 05 01:20 PM
Select method of range class failed sa02000[_5_] Excel Programming 5 October 5th 05 09:10 AM
What did I do? (Select Method of Range Class Failed ) HotRod Excel Programming 9 May 20th 05 02:11 PM
select method of range class failed Joseph[_40_] Excel Programming 0 September 28th 04 04:08 PM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"