Utterly Bamboozled
New Member
- Joined
- Jul 7, 2010
- Messages
- 39
Hi, could someone help me out in understanding why the below code doesn't work please?
Sub Export()
'
' Sheets("Timesheet").Copy Before:=Sheets(5)
ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
On Error Resume Next
ActiveSheet.Name = Range("C6").Text
On Error GoTo 0
If ActiveSheet.Name <> Range("C6").Text Then MsgBox "Couldn't rename the sheet as " & Range("C6").Text
ActiveSheet.Range("C6:E6").Select
End Sub
I get a runtime error 1004 - Application defined or Object defined error. When I debug it highlights ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
Thanks for your help.
Sub Export()
'
' Sheets("Timesheet").Copy Before:=Sheets(5)
ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
On Error Resume Next
ActiveSheet.Name = Range("C6").Text
On Error GoTo 0
If ActiveSheet.Name <> Range("C6").Text Then MsgBox "Couldn't rename the sheet as " & Range("C6").Text
ActiveSheet.Range("C6:E6").Select
End Sub
I get a runtime error 1004 - Application defined or Object defined error. When I debug it highlights ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value
Thanks for your help.