#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Param
 
Posts: n/a
Default macro command

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
  #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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Param
 
Posts: n/a
Default macro command

TQ so much!

"NAVEEN" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Macro Command VickyC Excel Discussion (Misc queries) 1 December 2nd 05 01:05 AM
Is it possible to insert a macro command in an "IF" function? SandyLACA Excel Worksheet Functions 4 November 8th 05 10:46 PM
2 part question - macro / command button John Excel Discussion (Misc queries) 3 April 16th 05 09:00 PM
macro ...if command, I suppose... Mario Excel Discussion (Misc queries) 4 December 11th 04 12:34 PM


All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"