macro command

P

Param

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
 
N

NAVEEN

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
 
P

Param

TQ so much!

NAVEEN said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top