Hello,
Can anyone correct this below mentioned script. I want to display a message if the range have empty cells or make cell empty and display the message.
Thanks in advance for your help.'If Sheets("Template").Range("A2:J65536") = " " Then 'Msg = "Records Already Empty." 'Style = vbOKOnly + vbInformation '+ vbDefaultButton2 'Title = "Underwriting Department" 'Response = MsgBox(Msg, Style, Title, Help, Ctxt) 'End If 'If Sheets("Template").Range("A2:J65536") <> "" Then 'Sheets("Template").Range("A2:J65536").ClearContents 'Msg = "Records Clear." 'Style = vbOKOnly + vbInformation '+ vbDefaultButton2 'Title = "Underwriting Department" 'Response = MsgBox(Msg, Style, Title, Help, Ctxt) 'End If
Last edited by hecgroups; 02-13-2012 at 11:05 AM.
With Worksheets("Template") If Application.CountA(.Range("A2:J65536")) = 0 Then Response = MsgBox("Records Already Empty.", vbOKOnly + vbInformation, "Underwriting Department") Else .Range("A2:J65536").ClearContents Response = MsgBox("Records Clear.", vbOKOnly + vbInformation, "Underwriting Department") End If End With
Thanks bob it works perfectly with my original file. Excellent script.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks