Run time error '1004'

albatross32

New Member
Joined
Feb 17, 2010
Messages
32
I am getting this error message.

This is my code;

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$O$9" Then

If Len(Target.Text) > 0 Then
Application.Wait (Now + TimeValue("0:00:01"))
Range("O9").Activate
Selection.ClearContents
Sheets("Sheet2").Activate
Range("P3").Activate
Range("P3").Select
Selection.Copy
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
Application.CutCopyMode = False

End If

End If


End Sub

Any thoughts. Spoon feed me please. I am Excel competent but not VBA professional!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
What are you trying to achieve, because that code does not make any sense to me: you clear a cell the user just changed, then you copy another cell to itself twice???
 
Upvote 0
I have a fairly detailed set of functions on Sheet2 that trigger an event on Sheet1. My code is then designed to reset Sheet1. For some reason, when my Sheet2 trigger has been completed I have to perform a task in Sheet2 to correctly reset the functions.

At the end of the day I want to clear O9 in Sheet1 then move to Sheet2 and reset the functions. The reset in Sheet2 is a Macro which consists of;

Select P2
Ctrl + C
Enter
Ctrl + C
Enter

I don't know why the functions need to be reset in this way but I know that the above procedure works.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top