mouse location

D

Dennis

I have a protected worksheet.

How can I insert a Row based on the location of the cursor using a Macro?

Need the location of the Row based on the location of the cursor.

Thanks
 
D

Dave Peterson

Something like...

Option Explicit
Sub testme()
Dim myPWD As String

myPWD = "hi"

ActiveSheet.Unprotect Password:=myPWD
ActiveCell.Offset(1, 0).Insert
ActiveSheet.Protect Password:=myPWD

End Sub

(this inserts a row under the activecell. remove .offset(1,0) if you want it
above the activecell.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Top