Results 1 to 3 of 3

Correct way to write VBA Macros

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    909

    Smile Correct way to write VBA Macros

    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.

    '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
    Thanks in advance for your help.
    Last edited by hecgroups; 02-13-2012 at 12:05 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1