Thread: macro command
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NAVEEN
 
Posts: n/a
Default macro command

Hi,

Try this code:

Sub Macro1()
myPWD = Application.InputBox("Enter a number")
If myPWD = "NAVEEN" Then
Range("D11:D25,F11:F25,H11:H25").Select
Range("H11").Activate
Selection.ClearContents
Range("D10").Select
Else
Msgbox "Wrong Password! Bye!"
End If
End Sub



Regards
NAVEEN

"Param" wrote:

I have create macro command to performe following task:

Sub Macro1()
Range("D11:D25,F11:F25,H11:H25").Select
Range("H11").Activate
Selection.ClearContents
Range("D10").Select
End Sub

my question, can i add to request password or ask Yes or No to proceed the
command.

tq- param