Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Inserting time in spreadsheet

  1. #11
    Member
    Join Date
    Nov 2012
    Posts
    33
    Rep Power
    0
    Here is the spreadsheet for January 2013. Maybe you can spot my error.

    Thanks

  2. #12
    Member rollis13's Avatar
    Join Date
    Nov 2012
    Posts
    36
    Rep Power
    0
    You probably started with a new book. Go to the menu Tools / then Options / in the Calculation Tab / check the Iteration checkbox / and make Maximum iterations = 1 .

  3. #13
    Member
    Join Date
    Nov 2012
    Posts
    33
    Rep Power
    0
    Yeppers, that's all it took.

    Thanks

  4. #14
    Member
    Join Date
    Nov 2012
    Posts
    33
    Rep Power
    0
    Well, I'm at it again, trying to get this spreadsheet to do what I need it to do. So far, so good, thanks to all the help from everyone here.

    Now, I need to protect ONLY certain parts of the sheet. All the places where I need to input figures should be available, but everything else needs to be protected against change, because sometimes when I'm in a hurry, I don't put the cursor in exactly the right spot, and if I don't notice it right away, I have a problem.

    Here is what I want:

    Code:
    The date and time columns need to be protected against change, but the level columns open for entry.
    
    Date              | Time   |Level| Time    |Level| Time    |Level| Time    |Level| 
    Tue, Oct 01, 2013 | 7:37AM | 110 | 12:25PM | 100 |  5:46PM |  97 | 10:07PM | 113 | 
    Wed, Oct 02, 2013 | 6:32AM | 108 |  1:23PM |  96 |  5:26PM |  96 | 12:04AM |  96 | 
    Thu, Oct 03, 2013 | 8:12AM | 142 |  2:33PM | 101 | 10:28PM |  73 |  1:12AM | 107 | 
    Fri, Oct 04, 2013 | 7:09AM |  87 | 12:33PM | 121 |  3:54PM |  97 | 11:31PM | 122 | 
    I have wrestled with the Review -> Protect Worksheet for a couple of days, and cannot get it right. And, oh, yeah, I'm using Microsoft Excel 2007

    Thanks for your help.

  5. #15
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    659
    Rep Power
    13
    Quote Originally Posted by papabill View Post
    Now, I need to protect ONLY certain parts of the sheet. All the places where I need to input figures should be available, but everything else needs to be protected against change, because sometimes when I'm in a hurry, I don't put the cursor in exactly the right spot, and if I don't notice it right away, I have a problem.

    Here is what I want:

    Code:
    The date and time columns need to be protected against change, but the level columns open for entry.
    
    Date              | Time   |Level| Time    |Level| Time    |Level| Time    |Level| 
    Tue, Oct 01, 2013 | 7:37AM | 110 | 12:25PM | 100 |  5:46PM |  97 | 10:07PM | 113 | 
    Wed, Oct 02, 2013 | 6:32AM | 108 |  1:23PM |  96 |  5:26PM |  96 | 12:04AM |  96 | 
    Thu, Oct 03, 2013 | 8:12AM | 142 |  2:33PM | 101 | 10:28PM |  73 |  1:12AM | 107 | 
    Fri, Oct 04, 2013 | 7:09AM |  87 | 12:33PM | 121 |  3:54PM |  97 | 11:31PM | 122 | 
    Something modeled around this should work for you...

    Code:
    Sub ProtectAllExceptLevels()
      Sheets("Sheet2").Unprotect
      Cells.Locked = True
      Intersect(Range("C:C,E:E,G:G,I:I").EntireColumn, Range("2:" & Rows.Count)).Locked = False
      Sheets("Sheet2").Protect
    End Sub

  6. #16
    Member
    Join Date
    Nov 2012
    Posts
    33
    Rep Power
    0
    I'm sorry, I'm not a programmer, so this is totally unknown to me. I'm gonna need some actions to take in the spreadsheet itself.

    Thanks

  7. #17
    Member rollis13's Avatar
    Join Date
    Nov 2012
    Posts
    36
    Rep Power
    0
    You need to right click the TabName of the sheet to open it's VBA panel then copy the macro in the right blank space.
    Have a try with this after changing the sheet's name in the macro (now it is Sheet1):
    Code:
    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim r As Long
        Dim c As Long
        Dim Cell As Range
        
        With Application
            .Calculation = xlCalculationManual
            .ScreenUpdating = False
            .DisplayAlerts = False
        End With
        
        If ActiveSheet.Name = "Sheet1" Then        'change name of sheet as needed
             'Resume to next line if any error occurs
            On Error Resume Next
            With ActiveSheet
                .Unprotect                          'unprotect entire sheet
                 'search for non blank cells and lock them and unlock blank cells
                For Each Cell In ActiveSheet.UsedRange
                    r = Cell.Row
                    c = Cell.Column
                    If Cell.Value <> "" Then
                        If Cell.Locked = False Then Cell.Locked = True
                    End If
                Next Cell
                .Protect                            'protect entire sheet
            End With
            
            With Application
                .Calculation = xlCalculationAutomatic
                .DisplayAlerts = True
                .ScreenUpdating = True
            End With
            
        End If
    End Sub
    Last edited by rollis13; 10-17-2013 at 03:25 AM.

  8. #18
    Junior Member
    Join Date
    Aug 2013
    Posts
    5
    Rep Power
    0
    try this sheet:
    Attached Files Attached Files

Similar Threads

  1. Calculate Time Difference Between Time In HH:MM
    By Stalker in forum Excel Help
    Replies: 8
    Last Post: 03-28-2013, 03:27 PM
  2. Budget Spreadsheet Template
    By rich_cirillo in forum Excel Help
    Replies: 1
    Last Post: 02-12-2013, 10:32 PM
  3. Displayin Date/Time in "original" time zone
    By Rasm in forum Excel Help
    Replies: 4
    Last Post: 04-21-2012, 02:02 AM
  4. Spreading a time range (shift time, etc) in columns.
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 1
    Last Post: 08-23-2011, 11:45 AM
  5. FreezePane In A Userform SpreadSheet Control 11.0
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 05-15-2011, 05:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •