I have the following code. It doesn't work. Says, "1004 Error", when implemented. Don't know what have done wrong.
Private Sub CommandButton1_Click()
Unload Me
ThisWorkbook.Sheets("Set Exams-Answers").Range("F21, H23:H26, F31, H33:H36, F41, H43:H46, F51, H53:H56, F61, H63:H66, F71, H73:H76, F81, H83:H86, F91, H93:H96, F101, H103:H106, F111, H113:H116, F121, H123:H126, F131, H133:H136, F141, H143:H146, F151, H153:H156, F161, H163:H166, F171, H173:H176, F181, H183:H186, F191, H193:H196, F201, H203:H206, F211, H213:H216, F221, H223:H226, F231, H233:H236, F241, H243:H246, F251, H253:H256, F261, H263:H266, P21, R23:R26, P31, R33:R36, P41, R43:R46, P51, R53:R56, P61, R63:R66, P71, R73:R76, P81, R83:R86, P91, R93:R96, P101, R103:R106, P111, R113:R116, P121, R123:R126, P131, R133:R136, P141, R143:R146, P151, R153:R156, P161, R163:R166, P171, R173:R176, P181, R183:R186, P191, R193:R196, P201, R203:R206, P211, R213:R216, P221, R223:R226, P231, R233:R236, P241, R243:R246, P251, R253:R256, P261, R263:R266").ClearContents 'Clear cell contents
SetQuestions1.Show
End Sub
Some, please help. Thank you.
Private Sub CommandButton1_Click()
Unload Me
ThisWorkbook.Sheets("Set Exams-Answers").Range("F21, H23:H26, F31, H33:H36, F41, H43:H46, F51, H53:H56, F61, H63:H66, F71, H73:H76, F81, H83:H86, F91, H93:H96, F101, H103:H106, F111, H113:H116, F121, H123:H126, F131, H133:H136, F141, H143:H146, F151, H153:H156, F161, H163:H166, F171, H173:H176, F181, H183:H186, F191, H193:H196, F201, H203:H206, F211, H213:H216, F221, H223:H226, F231, H233:H236, F241, H243:H246, F251, H253:H256, F261, H263:H266, P21, R23:R26, P31, R33:R36, P41, R43:R46, P51, R53:R56, P61, R63:R66, P71, R73:R76, P81, R83:R86, P91, R93:R96, P101, R103:R106, P111, R113:R116, P121, R123:R126, P131, R133:R136, P141, R143:R146, P151, R153:R156, P161, R163:R166, P171, R173:R176, P181, R183:R186, P191, R193:R196, P201, R203:R206, P211, R213:R216, P221, R223:R226, P231, R233:R236, P241, R243:R246, P251, R253:R256, P261, R263:R266").ClearContents 'Clear cell contents
SetQuestions1.Show
End Sub
Some, please help. Thank you.