Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Danny
 
Posts: n/a
Default DO NOT Insert Row - Macro

Hi,

I have a woksheet that I share with users. There is macro to insert row(s)
as needed. Some users INSERTS ROWS MANUALLY that makes the other macros in
the worksheet fail.

Is there a macro that will PREVENT users to Mannually Insert a Row and at
the same time my macro to automatically insert a row will still work?

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default DO NOT Insert Row - Macro

Protect the worksheet and modify your macro to unprotect the sheet, insert the
rows, protect the sheet.

You may want to provide them with a macro to delete rows, too.

Be aware that lots of things are disabled if the worksheet is protected. You'll
want to test before you distribute.

And worksheet protection is easily broken--so it's not foolproof.

Danny wrote:

Hi,

I have a woksheet that I share with users. There is macro to insert row(s)
as needed. Some users INSERTS ROWS MANUALLY that makes the other macros in
the worksheet fail.

Is there a macro that will PREVENT users to Mannually Insert a Row and at
the same time my macro to automatically insert a row will still work?

Thank you.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Danny
 
Posts: n/a
Default DO NOT Insert Row - Macro

Thanks for your response. I copied this macro from this NG that does not show
the Insert Bar.

However, the user will still be able to use a shortcut key. I can't find a
solution to that. If I protect the sheet, there will be more problems.

I hope that you can help me on preventing the user to use a shortcut key to
insert a row

Sub auto_Open()

'Disable/enable all of the POP-up Command Bars.
Dim CB As CommandBar
For Each CB In CommandBars
If CB.Type = msoBarTypePopup Then CB.Enabled = False
Next CB

'DISABLE/enable "customizing" toolbars.
CommandBars("Toolbar List").Enabled = False

'Disable/enable all Command Bars
For Each CB In Application.CommandBars
CB.Enabled = False
Next CB

'Disable/enable SELECTED Command Bar
Application.CommandBars("Worksheet Menu Bar").Enabled = True

'Disable/enable Wk Sheet Menu Controls

Application.CommandBars("Worksheet menu bar").Controls("Insert").Visible
= False




End Sub

"Dave Peterson" wrote:

Protect the worksheet and modify your macro to unprotect the sheet, insert the
rows, protect the sheet.

You may want to provide them with a macro to delete rows, too.

Be aware that lots of things are disabled if the worksheet is protected. You'll
want to test before you distribute.

And worksheet protection is easily broken--so it's not foolproof.

Danny wrote:

Hi,

I have a woksheet that I share with users. There is macro to insert row(s)
as needed. Some users INSERTS ROWS MANUALLY that makes the other macros in
the worksheet fail.

Is there a macro that will PREVENT users to Mannually Insert a Row and at
the same time my macro to automatically insert a row will still work?

Thank you.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default DO NOT Insert Row - Macro

You can catch the shortcut key with code like:

Option Explicit
Sub turnitoff()
Application.OnKey "^{107}", ""
End Sub
Sub turniton()
Application.OnKey "^{107}"
End Sub


I tried
Option Explicit
Sub turnitoff()
Application.OnKey "^{+}", ""
End Sub

But that didn't work for the + key on the numeric keypad.

But Jim Cone suggested {107} for use with that key--it worked for me on my
standard USA keyboard.


Danny wrote:

Thanks for your response. I copied this macro from this NG that does not show
the Insert Bar.

However, the user will still be able to use a shortcut key. I can't find a
solution to that. If I protect the sheet, there will be more problems.

I hope that you can help me on preventing the user to use a shortcut key to
insert a row

Sub auto_Open()

'Disable/enable all of the POP-up Command Bars.
Dim CB As CommandBar
For Each CB In CommandBars
If CB.Type = msoBarTypePopup Then CB.Enabled = False
Next CB

'DISABLE/enable "customizing" toolbars.
CommandBars("Toolbar List").Enabled = False

'Disable/enable all Command Bars
For Each CB In Application.CommandBars
CB.Enabled = False
Next CB

'Disable/enable SELECTED Command Bar
Application.CommandBars("Worksheet Menu Bar").Enabled = True

'Disable/enable Wk Sheet Menu Controls

Application.CommandBars("Worksheet menu bar").Controls("Insert").Visible
= False


End Sub

"Dave Peterson" wrote:

Protect the worksheet and modify your macro to unprotect the sheet, insert the
rows, protect the sheet.

You may want to provide them with a macro to delete rows, too.

Be aware that lots of things are disabled if the worksheet is protected. You'll
want to test before you distribute.

And worksheet protection is easily broken--so it's not foolproof.

Danny wrote:

Hi,

I have a woksheet that I share with users. There is macro to insert row(s)
as needed. Some users INSERTS ROWS MANUALLY that makes the other macros in
the worksheet fail.

Is there a macro that will PREVENT users to Mannually Insert a Row and at
the same time my macro to automatically insert a row will still work?

Thank you.


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Danny
 
Posts: n/a
Default DO NOT Insert Row - Macro

Thanks a lot Dave. Have a great evening!

"Dave Peterson" wrote:

You can catch the shortcut key with code like:

Option Explicit
Sub turnitoff()
Application.OnKey "^{107}", ""
End Sub
Sub turniton()
Application.OnKey "^{107}"
End Sub


I tried
Option Explicit
Sub turnitoff()
Application.OnKey "^{+}", ""
End Sub

But that didn't work for the + key on the numeric keypad.

But Jim Cone suggested {107} for use with that key--it worked for me on my
standard USA keyboard.


Danny wrote:

Thanks for your response. I copied this macro from this NG that does not show
the Insert Bar.

However, the user will still be able to use a shortcut key. I can't find a
solution to that. If I protect the sheet, there will be more problems.

I hope that you can help me on preventing the user to use a shortcut key to
insert a row

Sub auto_Open()

'Disable/enable all of the POP-up Command Bars.
Dim CB As CommandBar
For Each CB In CommandBars
If CB.Type = msoBarTypePopup Then CB.Enabled = False
Next CB

'DISABLE/enable "customizing" toolbars.
CommandBars("Toolbar List").Enabled = False

'Disable/enable all Command Bars
For Each CB In Application.CommandBars
CB.Enabled = False
Next CB

'Disable/enable SELECTED Command Bar
Application.CommandBars("Worksheet Menu Bar").Enabled = True

'Disable/enable Wk Sheet Menu Controls

Application.CommandBars("Worksheet menu bar").Controls("Insert").Visible
= False


End Sub

"Dave Peterson" wrote:

Protect the worksheet and modify your macro to unprotect the sheet, insert the
rows, protect the sheet.

You may want to provide them with a macro to delete rows, too.

Be aware that lots of things are disabled if the worksheet is protected. You'll
want to test before you distribute.

And worksheet protection is easily broken--so it's not foolproof.

Danny wrote:

Hi,

I have a woksheet that I share with users. There is macro to insert row(s)
as needed. Some users INSERTS ROWS MANUALLY that makes the other macros in
the worksheet fail.

Is there a macro that will PREVENT users to Mannually Insert a Row and at
the same time my macro to automatically insert a row will still work?

Thank you.

--

Dave Peterson


--

Dave Peterson

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
Is it possible to insert a macro command in an "IF" function? SandyLACA Excel Worksheet Functions 4 November 8th 05 10:46 PM
macro to insert row after specific text Luke Excel Discussion (Misc queries) 2 September 19th 05 04:06 PM
asking again, macro to insert rows Luke Excel Worksheet Functions 12 September 18th 05 06:32 PM
How do I insert a prompt into an Excel macro? TangoHammer Excel Discussion (Misc queries) 1 August 4th 05 09:31 PM
Insert macro into formula Paul Excel Worksheet Functions 1 May 12th 05 08:25 PM


All times are GMT +1. The time now is 11:05 PM.

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

About Us

"It's about Microsoft Excel"