Drawback of Copy and Clear code [Solved/Closed]

Report
Posts
77
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
-
Posts
77
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
-
Hello,

I have requested that please solve this issued if it could be solved.
I have found major drawback (May be I am wrong) in the code of Copy data and Clear Data is that whenever it executed, the ruining VBA Code is stop working.
Is Their any possibility that running code is function properly.

Copy Data Code
Sub CopyData()
Worksheets("311").Range("B11:E510").Value = Worksheets("301").Range("B11:E510").Value

Application.CutCopyMode = False

End Sub

and Other Clear Data Code

Sub ClearData()
'
' ClearData Macro
'
Range("B11:E1000").ClearContents

'
End Sub

Thanks for your care.


1 reply

Posts
2758
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
June 17, 2021
462
Hi Smuneeb,

Aside from an unnecessary code line, there seems nothing wrong with the code.

You say the code stops working. But there is only 1 line per code, after hat line is executed the code stops. Are you expecting some kind of loop?

Best regards,
Trowa
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Posts
77
Registration date
Saturday September 5, 2015
Status
Member
Last seen
March 8, 2017
1
Hi Trowa
Thanks for response. I wont need any kind of loop
Regards
Muneeb

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!