menor59
03-13-2013, 08:21 PM
im using the following VBA
Sub CopyAndPaste()
Dim sh As Worksheet, S As Worksheet
For Each sh In ActiveWorkbook.Worksheets
If InStr(sh.Name, "Union dues") > 0 Then
Set S = sh
Exit For
End If
Next sh
With Sheets("Blank")
.Range("AE11:AR11").Copy Destination:=S.Range("G4:T4")
Application.CutCopyMode = False
End With
End Sub
But its erroring out here
.Range("AE11:AR11").Copy Destination:=S.Range("G4:T4")
Im trying to copy a Range of cells from my work sheet entitled BLANK and paste that range of cells to a work sheet that Contains Union dues with a wildcard at the end...
any thoughts?
Sub CopyAndPaste()
Dim sh As Worksheet, S As Worksheet
For Each sh In ActiveWorkbook.Worksheets
If InStr(sh.Name, "Union dues") > 0 Then
Set S = sh
Exit For
End If
Next sh
With Sheets("Blank")
.Range("AE11:AR11").Copy Destination:=S.Range("G4:T4")
Application.CutCopyMode = False
End With
End Sub
But its erroring out here
.Range("AE11:AR11").Copy Destination:=S.Range("G4:T4")
Im trying to copy a Range of cells from my work sheet entitled BLANK and paste that range of cells to a work sheet that Contains Union dues with a wildcard at the end...
any thoughts?