Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-10-2008, 04:42 PM
Greg
 
Posts: n/a
General Novice Questions (Protection, Format)

I have created a spreadsheet and have restricted a row and footing row
(totals) from being changed by using the "format cells / protection"
feature. I have left all the data entry rows
unprotected so that the entry people can make changes. These entry
rows have columns with specfics formats like Date, Currency, etc and I
make it all look nice with the grid feature. Finally,
I set "Tools /Protection/ Protect sheet" to active the protected
cells.

The problem is how can the user Insert new rows?
To get around this, I created enough rows so that the user has the
space they need (50 rows) to accomodate the necessary entries. The
new problem is that if the user forgets to make any entry they have to
Insert which they cannot do because of the protection. So, to get
around this they can drag the lower existing data rows down, but then
the opening they create loses the format that I set for that column
and the nice grid I put in disappears in those rows?

Any tips?

Thanks


Reply With Quote
  #2 (permalink)  
Old 05-10-2008, 05:09 PM
Ron Coderre
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

Depending on your version of Excel, you may have this option....

From the Excel Main Menu:
<tools><protection><protect sheet>
Allow:
....Check: Insert rows
....Check: Format rows
Set the Password
Click [OK]

Now the users will be able to insert rows
and those rows will inherit the format
from the row above.

Another alternative is to put
the total row ABOVE the data.

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)


"Greg" <ApexData@gmail.com> wrote in message
news:777925a9-d63d-4b2a-b1f1-c56c16266bd8@j22g2000hsf.googlegroups.com...
> I have created a spreadsheet and have restricted a row and footing row
> (totals) from being changed by using the "format cells / protection"
> feature. I have left all the data entry rows
> unprotected so that the entry people can make changes. These entry
> rows have columns with specfics formats like Date, Currency, etc and I
> make it all look nice with the grid feature. Finally,
> I set "Tools /Protection/ Protect sheet" to active the protected
> cells.
>
> The problem is how can the user Insert new rows?
> To get around this, I created enough rows so that the user has the
> space they need (50 rows) to accomodate the necessary entries. The
> new problem is that if the user forgets to make any entry they have to
> Insert which they cannot do because of the protection. So, to get
> around this they can drag the lower existing data rows down, but then
> the opening they create loses the format that I set for that column
> and the nice grid I put in disappears in those rows?
>
> Any tips?
>
> Thanks
>
>


Reply With Quote
  #3 (permalink)  
Old 05-10-2008, 05:20 PM
Earl Kiosterud
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

Greg,

Once the worksheet is protected, as you know, inserting is disallowed. Drag-moving is
allowed, but should not be used if there are formulas in the worksheet, as it's possible
that the formulas will change as a result of the move. Drag-moving is a design tool, not a
data entry tool.

The best way would be to have a macro available for the user. It would unprotect the sheet,
insert the new row (perhaps where the active cell is currently), then re--protect the sheet.
The macro could be invoked by a button, a keyboard shortcut, or even a new menu item. You'd
probably also want a macro to remove a row, in the event that a user adds a row, then later
doesn't want it.

We can write the macro for you if you're able to put a macro in your sheet. You can bone up
on how to work with macros it at www.mcgimpsey.com if you're interested. Post back for the
macro code.
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

-----------------------------------------------------------------------
"Greg" <ApexData@gmail.com> wrote in message
news:777925a9-d63d-4b2a-b1f1-c56c16266bd8@j22g2000hsf.googlegroups.com...
>I have created a spreadsheet and have restricted a row and footing row
> (totals) from being changed by using the "format cells / protection"
> feature. I have left all the data entry rows
> unprotected so that the entry people can make changes. These entry
> rows have columns with specfics formats like Date, Currency, etc and I
> make it all look nice with the grid feature. Finally,
> I set "Tools /Protection/ Protect sheet" to active the protected
> cells.
>
> The problem is how can the user Insert new rows?
> To get around this, I created enough rows so that the user has the
> space they need (50 rows) to accomodate the necessary entries. The
> new problem is that if the user forgets to make any entry they have to
> Insert which they cannot do because of the protection. So, to get
> around this they can drag the lower existing data rows down, but then
> the opening they create loses the format that I set for that column
> and the nice grid I put in disappears in those rows?
>
> Any tips?
>
> Thanks
>
>



Reply With Quote
  #4 (permalink)  
Old 05-10-2008, 06:14 PM
Greg
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

I have programmed with MS Access frequently and am familiar with VBA.
Can you give sample code for a button to Add and one for Del and how
to go about it.
I think once I see it, I'll be on the way to getting this
accomplished.

Thanks Again
Greg







On May 10, 12:20*pm, "Earl Kiosterud" <some...@nowhere.com> wrote:
> Greg,
>
> Once the worksheet is protected, as you know, inserting is disallowed. *Drag-moving is
> allowed, but should not be used if there are formulas in the worksheet, asit's possible
> that the formulas will change as a result of the move. *Drag-moving is adesign tool, not a
> data entry tool.
>
> The best way would be to have a macro available for the user. *It would unprotect the sheet,
> insert the new row (perhaps where the active cell is currently), then re--protect the sheet.
> The macro could be invoked by a button, a keyboard shortcut, or even a newmenu item. *You'd
> probably also want a macro to remove a row, in the event that a user adds a row, then later
> doesn't want it.
>
> We can write the macro for you if you're able to put a macro in your sheet.. *You can bone up
> on how to work with macros it atwww.mcgimpsey.comif you're interested. *Post back for the
> macro code.
> --
> Regards from Virginia Beach,
>
> Earl Kiosterudwww.smokeylake.com
>
> -----------------------------------------------------------------------"Greg" <ApexD...@gmail.com> wrote in message
>
> news:777925a9-d63d-4b2a-b1f1-c56c16266bd8@j22g2000hsf.googlegroups.com...
>
>
>
> >I have created a spreadsheet and have restricted a row and footing row
> > (totals) from being changed by using the "format cells / protection"
> > feature. *I have left all the data entry rows
> > unprotected so that the entry people can make changes. *These entry
> > rows have columns with specfics formats like Date, Currency, etc and I
> > make it all look nice with the grid feature. Finally,
> > I set "Tools /Protection/ Protect sheet" to active the protected
> > cells.

>
> > The problem is how can the user Insert new rows?
> > To get around this, I created enough rows so that the user has the
> > space they need (50 rows) to accomodate the necessary entries. *The
> > new problem is that if the user forgets to make any entry they have to
> > Insert which they cannot do because of the protection. So, to get
> > around this they can drag the lower existing data rows down, but then
> > the opening they create loses the format that I set for that column
> > and the nice grid I put in disappears in those rows?

>
> > Any tips?

>
> > Thanks- Hide quoted text -

>
> - Show quoted text -


Reply With Quote
  #5 (permalink)  
Old 05-10-2008, 06:16 PM
Greg
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

I'm using MS EXCEL 2000
Reply With Quote
  #6 (permalink)  
Old 05-10-2008, 07:20 PM
Greg
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

I figured out how to create Add / Del buttons and tied this code to
it.
It seems to be working fine. Anyone recognize any problems or
oversights ?

Thanks
Greg

Private Sub CommandButton1_Click()
Me.Unprotect
Rows(ActiveCell.Row).Delete
Me.Protect
End Sub

Private Sub CommandButton2_Click()
Me.Unprotect
Rows(ActiveCell.Row).Insert
Me.Protect
End Sub
Reply With Quote
  #7 (permalink)  
Old 05-10-2008, 07:29 PM
Earl Kiosterud
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

Greg,

Here are the macros. Put them in a regular module, and assign them to keyboard shortcuts, if
desired (Tools - Macros - Macros - Options). Or put a buttons on the sheet (drawing
toolbar), and assign them to the macros.

Sub InsertRow()
If ActiveCell.Locked = True Then
MsgBox "You can't insert a row here", vbOKOnly, ""
Exit Sub
End If
ActiveSheet.Unprotect Password:="aa"
ActiveCell.EntireRow.Insert
ActiveSheet.Protect Password:="aa"
End Sub

Sub DeleteRow()
If ActiveCell.Locked = True Then
MsgBox "You can't remove a row here", vbOKOnly, ""
Exit Sub
End If
ActiveSheet.Unprotect Password:="aa"
ActiveCell.EntireRow.Delete
ActiveSheet.Protect Password:="aa"
End Sub


These routines will allow inserting/deleting rows based on the active cell being protected.
If there are other cells in the sheet that are unprotected, they'll allow
inserting/deleting, which is undesirable. If there are such other cells, we'll need another
means of checking. Post back if that's the case.

If you're not using passwords in your sheet protection, remove the Password:="aa" part.
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com
-----------------------------------------------------------------------
"Greg" <ApexData@gmail.com> wrote in message
news:5083b55c-66ac-415c-8e04-6c57ffaf09cb@x41g2000hsb.googlegroups.com...
I have programmed with MS Access frequently and am familiar with VBA.
Can you give sample code for a button to Add and one for Del and how
to go about it.
I think once I see it, I'll be on the way to getting this
accomplished.

Thanks Again
Greg







On May 10, 12:20 pm, "Earl Kiosterud" <some...@nowhere.com> wrote:
> Greg,
>
> Once the worksheet is protected, as you know, inserting is disallowed. Drag-moving is
> allowed, but should not be used if there are formulas in the worksheet, as it's possible
> that the formulas will change as a result of the move. Drag-moving is a design tool, not a
> data entry tool.
>
> The best way would be to have a macro available for the user. It would unprotect the
> sheet,
> insert the new row (perhaps where the active cell is currently), then re--protect the
> sheet.
> The macro could be invoked by a button, a keyboard shortcut, or even a new menu item.
> You'd
> probably also want a macro to remove a row, in the event that a user adds a row, then
> later
> doesn't want it.
>
> We can write the macro for you if you're able to put a macro in your sheet. You can bone
> up
> on how to work with macros it atwww.mcgimpsey.comif you're interested. Post back for the
> macro code.
> --
> Regards from Virginia Beach,
>
> Earl Kiosterudwww.smokeylake.com
>
> -----------------------------------------------------------------------"Greg"
> <ApexD...@gmail.com> wrote in message
>
> news:777925a9-d63d-4b2a-b1f1-c56c16266bd8@j22g2000hsf.googlegroups.com...
>
>
>
> >I have created a spreadsheet and have restricted a row and footing row
> > (totals) from being changed by using the "format cells / protection"
> > feature. I have left all the data entry rows
> > unprotected so that the entry people can make changes. These entry
> > rows have columns with specfics formats like Date, Currency, etc and I
> > make it all look nice with the grid feature. Finally,
> > I set "Tools /Protection/ Protect sheet" to active the protected
> > cells.

>
> > The problem is how can the user Insert new rows?
> > To get around this, I created enough rows so that the user has the
> > space they need (50 rows) to accomodate the necessary entries. The
> > new problem is that if the user forgets to make any entry they have to
> > Insert which they cannot do because of the protection. So, to get
> > around this they can drag the lower existing data rows down, but then
> > the opening they create loses the format that I set for that column
> > and the nice grid I put in disappears in those rows?

>
> > Any tips?

>
> > Thanks- Hide quoted text -

>
> - Show quoted text -



Reply With Quote
  #8 (permalink)  
Old 05-10-2008, 09:37 PM
Greg
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

Thanks Earl

This is what I came up with I had some additional issues that had to
be addressed:

Private Sub CommandButton1_Click()
'Insert Row Button
If ActiveCell.Row > 6 And ActiveSheet.UsedRange.Rows.Count >
ActiveCell.Row Then
Me.Unprotect
Rows(ActiveCell.Row).Insert
Me.Protect
Else
Beep
End If
End Sub

Private Sub CommandButton2_Click()
'Delete Row Button
If ActiveCell.Row > 6 And ActiveSheet.UsedRange.Rows.Count >
ActiveCell.Row Then
Me.Unprotect
Rows(ActiveCell.Row).Delete
Me.Protect
Else
Beep
End If
End Sub


Thanks Again
Greg
Reply With Quote
  #9 (permalink)  
Old 05-11-2008, 04:53 AM
Earl Kiosterud
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

Greg,

Looks good, except the UsedRange can get bloated. When you've deleted rows, it still can
show a used range larger than it currently is. Closing and reopening the workbook is the
usual way to reset it. It sounds as though your records go to the bottom of your used
range, and there are no totals and other junk below them (your Access roots are showing!
:) ). In that case it probably doesn't matter if anyone inserts or deletes rows beyond your
last record.
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

-----------------------------------------------------------------------
"Greg" <ApexData@gmail.com> wrote in message
news:2f21b7bd-6a82-4459-bbd6-694cc1ec3113@p25g2000hsf.googlegroups.com...
> Thanks Earl
>
> This is what I came up with I had some additional issues that had to
> be addressed:
>
> Private Sub CommandButton1_Click()
> 'Insert Row Button
> If ActiveCell.Row > 6 And ActiveSheet.UsedRange.Rows.Count >
> ActiveCell.Row Then
> Me.Unprotect
> Rows(ActiveCell.Row).Insert
> Me.Protect
> Else
> Beep
> End If
> End Sub
>
> Private Sub CommandButton2_Click()
> 'Delete Row Button
> If ActiveCell.Row > 6 And ActiveSheet.UsedRange.Rows.Count >
> ActiveCell.Row Then
> Me.Unprotect
> Rows(ActiveCell.Row).Delete
> Me.Protect
> Else
> Beep
> End If
> End Sub
>
>
> Thanks Again
> Greg



Reply With Quote
  #10 (permalink)  
Old 05-14-2008, 05:08 PM
Greg
 
Posts: n/a
Re: General Novice Questions (Protection, Format)

Thanks Earl

Actually I do have totals at the bottom of the worksheet. I guest I
could move them up to the top.
The problem now is that the range does expand causing the worksheet to
get larger than I would like.
Is there a way to lock in the totals row to the specific location (say
row50). O create some kind of restrictive
window. Or do I need to build logic into my existing code to make the
adjustments somehow in response to the
button being pressed?

Thanks
Greg


On May 10, 11:53*pm, "Earl Kiosterud" <some...@nowhere.com> wrote:
> Greg,
>
> Looks good, except the UsedRange can get bloated. *When you've deleted rows, it still can
> show a used range larger than it currently is. *Closing and reopening the workbook is the
> usual way to reset it. *It sounds as though your records go to the bottom of your used
> range, and there are no totals and other junk below them (your Access roots are showing!
> :) ). *In that case it probably doesn't matter if anyone inserts or deletes rows beyond your
> last record.
> --
> Regards from Virginia Beach,
>
> Earl Kiosterudwww.smokeylake.com
>
> -----------------------------------------------------------------------"Greg" <ApexD...@gmail.com> wrote in message
>
> news:2f21b7bd-6a82-4459-bbd6-694cc1ec3113@p25g2000hsf.googlegroups.com...
>
>
>
> > Thanks Earl

>
> > This is what I came up with I had some additional issues that had to
> > be addressed:

>
> > Private Sub CommandButton1_Click()
> > * *'Insert Row Button
> > * *If ActiveCell.Row > 6 And ActiveSheet.UsedRange.Rows.Count >
> > ActiveCell.Row Then
> > * * * *Me.Unprotect
> > * * * *Rows(ActiveCell.Row).Insert
> > * * * *Me.Protect
> > * *Else
> > * * * *Beep
> > * *End If
> > End Sub

>
> > Private Sub CommandButton2_Click()
> > * *'Delete Row Button
> > * *If ActiveCell.Row > 6 And ActiveSheet.UsedRange.Rows.Count >
> > ActiveCell.Row Then
> > * * * Me.Unprotect
> > * * * Rows(ActiveCell.Row).Delete
> > * * * Me.Protect
> > * *Else
> > * * * Beep
> > * *End If
> > End Sub

>
> > Thanks Again
> > Greg- Hide quoted text -

>
> - Show quoted text -


Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



All times are GMT. The time now is 04:34 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Loans | SanDisk Flash Memory Card | Electricity Suppliers | Per Insurance | Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114