msg error with part of code???

C

Corey

Code Section Purpose:
Copies a Cell value from sheet and places the value in specific cells in
another sheet(Enter - Exit).
Then Clears the Clipboard memory, incase no paste function occurs.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Other Code Precedes this code
Range("K2").Copy
Sheets("Enter - Exit").Select
If Range("I14").Value = "" Then ' <=========== Option 1
Range("I14").PasteSpecial xlPasteValues
Application.CutCopyMode = False
Sheet4.Select
Range("A1").Select
Else
If Range("I16").Value = "" Then ' <========== Option 2
Range("I16").PasteSpecial xlPasteValues
Application.CutCopyMode = False
Sheet4.Select
Range("A1").Select
Else
If Range("I18").Value = "" Then ' <========== Option 3
Range("I18").PasteSpecial xlPasteValues
Application.CutCopyMode = False
Sheet4.Select
Range("A1").Select
Application.DisplayAlerts = True
Else ' <============================ Option 4
Application.DisplayAlerts = True
msgbox "Copy/Paste Not Required!!!"
' More Code follows this line
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With above code, there is 4 options that can run.
If the option 1 in run i get No Error msg
If either Option 2-3 run i get an error msg but it does not give me the
otpion to Debug. (Run Time Error 424: Object Required)

The ONLY thing i have noticed is that the Copied Cell is not cleared with
the Options 2-3, although i have the code :
Application.CutCopyMode = False inserted to clear the clipboard.

Why is this so ?
How do i fix it?
Regards

Corey
 
G

Guest

Try putting the 4 in parentheses (4) to select Sheets(4). That might stop
the error message.
 
C

Corey

Not it.

Seem to still get the error.
I have change the sheet4 and sheet(4) to sheets("sheet name") and still get
the same error


Any idea's

Corey....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top