Run-time error '1004'

  • Hello Sir,

    I have a worksheet as attached which needs someone helping me how to make my VB code works.

    The problems are as follows:
    i. A " Run-time error '1004' pops up after I click the run "button" when the sheet Protected .
    ii. If it is "unprotected" the items at columns "BA:BE" will automatically moved to " column AY".


    Your help is very much appreciated. Thank you.

  • Re: Run-time error '1004'


    Quote

    ii. If it is "unprotected" the items at columns "BA:BE" will automatically moved to " column AY".


    The sheet protection doesn't have anything to do with that, it just stops the macro from running.
    Unprotect the sheet and add this

    Code
    .CurrentRegion.Select
                MsgBox Selection.Address
                Exit Sub


    between these two lines and see where you're actually asking for things to happen (comment them out later.)

    Code
    With .Offset(1, .Columns.Count + 1).Resize(1, 5)
                
                .CurrentRegion.Clear
  • Re: Run-time error '1004'


    Hi Sir,
    Honestly, I am very new to VB. I can't solve this problem. Wil you please, please help me.
    Thank you very much, May God bless you.

  • Re: Run-time error '1004'


    You might just pasted the code from somewhere I don't remember, but that code needs to be modified to suite your request, not just unprotect/protect.

  • Re: Run-time error '1004'


    Hi again Sir,

    Yes, thats true Sir. I still use the code that you have given me sometimes November 3rd 2014 ( Sch. Timetable analysis). It really works perfectly but when I edit to a new look, I am really Dump. I really hope you could assist me Sir . Your help is very much appreciated.Thank you very much.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!