+ Reply to Thread
Results 1 to 7 of 7

Problem with micros when locking cells

  1. #1
    Registered User
    Join Date
    08-19-2015
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2010
    Posts
    3

    Problem with micros when locking cells

    Hello!

    I don't know anything about macros and I need to find the answer to my question fast. My apologies to all for that. Not lazy, just out of time.

    My issue (other than not knowing anything on the subject):
    I have a sheet which contains micros - it has a button (created to make it easier for customers) that is supposed to add rows to a specific table. Under that table there is another one, which contains formulas and for that reason needs to be locked. The button works fine and adds rows only when there are no locked cells. If I lock even 1 cell, the button stops working and displays "Run-time error 1004: Insert method of Range class field".

    The code is:
    Private Sub CommandButton1_Click()
    With Range(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 11))
    .Copy
    .Insert shift:=xlDown
    Application.CutCopyMode = False

    End With
    Cells(ActiveCell.Row + 1, 1) = "=" & Cells(ActiveCell.Row, 1).Address & "+1"

    End Sub

    I am clueless, even after several hours of Internet digging. Is it missing the sheet's name, is it my brain that's missing... can't tell. I usually dig and learn, but like I said, time is running out and my boss is breathing down my neck.
    Can somebody help me, please... , MUCH, MUCH APPRECIATED!

    Irina

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Problem with micros when locking cells

    If your sheet is password protected, have the procedure Unprotect, Insert, then reProtect the sheet.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-19-2015
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2010
    Posts
    3

    Re: Problem with micros when locking cells

    Thank you, AlphaFrog!

    Your reply was fast and the solution was spot on! It worked like a charm It really is great to know your stuff!
    I have another question, I hope it's not a bother. For some reason, when my colleague opens the file in question on her computer (even before anythng is locked or protected), the formulas in the lower table work and all is calculated fine. When I open the file on my computer though, nothing is calculated. We both have the same Excel version, part of Microsoft Office Professional Plus 2010.
    Would you happen to have a solution for that? I am attaching the darn thing here, and though it's written in Bulgarian, I think it shouldn't matter much. When numbers are put in clumns C, D, G and H (I have done so in rows 10 to 14), there should be a result appearing in the bottom table. But it only happens on some computers and not on others, although all are working with the same Excel version.
    We are all puzzled and can't figure out why that happens. I would appreciate your input on the matter, if you have the time and don't mind me asking. THANKS ONCE AGAIN!

    Irina
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Problem with micros when locking cells

    May be Version issue...

    but it shouldnt happen.. i mean it never happens..
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  5. #5
    Registered User
    Join Date
    08-21-2005
    MS-Off Ver
    2013
    Posts
    23

    Re: Problem with micros when locking cells

    Hello Irina,

    On the problem computers, when you open the Excel workbook, in the lower left of the screen does it show "Calculate"? It should only say "Ready".

    If it says Calculate, check to make sure that Excel isn't set to Manual calculations instead of Automatic.
    You can change the setting via:
    With the workbook open in File>Options>Formulas....
    Under "Calculation Options"
    Make sure "Automatic" is selected then Click OK.

    Try to change numbers again.
    I can't detect anything referencing to column "C" that would make a cell change.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Problem with micros when locking cells

    Just a guess; Under Excel Options, check if Excel is set to Automatic calculation instead of Manual.
    1. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 and Excel 2013 display the File tab of the ribbon and then click Options.)
    2. Click the Formulas option at the left of the dialog box.
    3. In the Calculation Options section of the dialog box, make sure the Automatic radio button is selected.
    4. Click on OK.

    Understanding Calculation

  7. #7
    Registered User
    Join Date
    08-19-2015
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2010
    Posts
    3

    Re: Problem with micros when locking cells

    Hello AlphaFrog,

    Thanks for getting back to me. Without my devine intervention, bottom left was reading (and still is) "Ready" and calculation options is on "Automatic". Beats me. For the time being, I have given up on the issue (actually put the whole document on the shelf, as it developed more health problems, to my delight). I've got bigger fish that's frying ME...

    Anyway, I hope I can reach for further help, if needed... Afraid I will be needing

    Take care for now (actually, always )
    Irina

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Locking specific cells eventually changing to locking all cells
    By davidingilbert in forum Excel General
    Replies: 1
    Last Post: 03-19-2013, 06:50 PM
  2. Help with macro, automatical locking cells when excel is closed but only locking 1 sh
    By snoopy1461 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2011, 11:29 AM
  3. Cells locking Problem
    By windaroo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2010, 09:30 AM
  4. Locking Cells Problem
    By mickyblue in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-09-2008, 12:32 AM
  5. Problem with Locking cells
    By hgufrin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-23-2007, 07:43 AM
  6. Locking cells problem
    By punter in forum Excel General
    Replies: 4
    Last Post: 01-29-2007, 01:10 PM
  7. Replies: 1
    Last Post: 07-21-2006, 11:05 AM
  8. [SOLVED] micros
    By djmimi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-09-2005, 02:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1