imback2nite
Board Regular
- Joined
- Oct 30, 2004
- Messages
- 211
- Office Version
- 2003 or older
- Platform
- Windows
I've written this and don't know what is going wrong.
It all works except for the
The rest of the ElseIf's work fine. I tried deleting the code below and it works fine but I do need it. Any help wound be appreciated.
[/CODE] Because the code works fine without it.
Rich (BB code):
Private Sub CommandButton3_Click()
If Range("3:2544").EntireRow.Hidden = False Then
MsgBox ("Select Which Week To Update Names")
Exit Sub
ElseIf Range("4:6").EntireRow.Hidden = False Then
Range("B8:B47").ClearContents
Worksheets("Names").Range("B2:B41").Copy
Range("B8").PasteSpecial Paste:=xlPasteValues
ElseIf Range("51:54").EntireRow.Hidden = False Then
Range("B56:B95").ClearContents
Worksheets("Names").Range("B2:B41").Copy
Range("B56").PasteSpecial Paste:=xlPasteValues
ElseIf Range("99:102").EntireRow.Hidden = False Then
Range("B104:B143").ClearContents
Worksheets("Names").Range("B2:B41").Copy
Range("B104").PasteSpecial Paste:=xlPasteValues
ElseIf Range("147:150").EntireRow.Hidden = False Then
Range("B152:B191").ClearContents
Worksheets("Names").Range("B2:B41").Copy
Range("B152").PasteSpecial Paste:=xlPasteValues
End If
Application.CutCopyMode = False
Range("B1").Select
Application.ScreenUpdating = True
End Sub
Rich (BB code):
ElseIf Range("4:6").EntireRow.Hidden = False Then
Range("B8:B47").ClearContents
Worksheets("Names").Range("B2:B41").Copy
Range("B8").PasteSpecial Paste:=xlPasteValues
Rich (BB code):
If Range("3:2544").EntireRow.Hidden = False Then
MsgBox ("Select Which Week To Update Names")
Exit Sub