ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   mouse location (https://www.excelbanter.com/excel-discussion-misc-queries/101196-mouse-location.html)

dennis

mouse location
 
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

Dave Peterson

mouse location
 
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

Dennis wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com