View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Message Box: Delete row x?

Option Explicit
Sub testme()
Dim resp As Long
resp = MsgBox(Prompt:="Are you sure you want to delete row " & ActiveCell.Row, _
Buttons:=vbYesNo)
If resp = vbYes Then
'unprotect the sheet
ActiveCell.EntireRow.Delete
'protect the sheet
End If
End Sub

Tami wrote:

i have a macro designed to allow a user to delete a row in a protected
worksheet.
In the message box, i'd like to prompt the user as follows:
"Are you sure you want to delete row x?" with X being the row number of
where the cursor is currently sitting.
thanks in advance,
tami


--

Dave Peterson