+ Reply to Thread
Results 1 to 12 of 12

Run Time Error 1004 on code

  1. #1
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Run Time Error 1004 on code

    Hi, i am trying to understand what the following code does, as efernandes wrote some code for me but when running this i get the following error:

    Run time error '1004'
    Application defined or object defined error

    when clicking on debug:

    it points to the following code:

    Please Login or Register  to view this content.
    can any1 help me understand why i get this error. Thanks in advance.

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Run Time Error 1004 on code

    Hi,

    It's because of the syntax you are using here:
    Please Login or Register  to view this content.
    Are you using Excel 2007 or Excel 2010?
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Run Time Error 1004 on code

    A bit more of the code in question would be an advantage, we can only guess with what you have given.

    Posting the workbook will get you the fastest solution.

  4. #4
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Run Time Error 1004 on code

    Thanks guys for your responses. I am using Excel 2007.

    Also Marcol, apologies, I have attached a sample workbook which shows a popup once you enter, so if you just type the value "L4 B", press OK, then you will see the error popup after that.

    Thanks once again guys.
    Attached Files Attached Files

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Run Time Error 1004 on code

    There appears to be more than what you have indicated wrong with your code, it refers to named ranges that don't exist, and where they do there are other errors.

    What are you trying to do?
    I'm lost trying to follow the code with the number of errors it throws and the possible solutions.

  6. #6
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Run Time Error 1004 on code

    Thanks marcol for taking the time to help me. The following post:

    http://www.excelforum.com/excel-prog...dd-column.html

    Was responded by efernandes who kindly put some code together
    which I have tried to implement but came across the error I have posted. Any advise or help would be really appreciated. I have tried to get in touch with efernandes but I have had no response so thought I would try and fix this proble
    .

    Thanks once again.

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Run Time Error 1004 on code

    Okay, bad timing, got to go now.

    If nobody else solves this, I'll have a go, probably tomorrow.

  8. #8
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Run Time Error 1004 on code

    marcol, thanks.

  9. #9
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Run Time Error 1004 on code

    Hi Marcol, sorry to trouble, just wondering if you have had a chance to look at the above issue ... thanks

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Run Time Error 1004 on code

    I have looked at both posts and all the posted workbooks to date and have absolutely no idea what you are trying to do.

    If we are to make any progress at all then I suggest we go back to the beginning.

    Mock up a new workbook showing what the final workbook should look like and post it.
    Don't put any code in this sample, what you have so far is littered with either redundant/missing or wrong code and references.

    Try explaining what you are wanting to happen step-by-step.

    Perhaps someone else can see what you are aiming at, but I, for one, am completely baffled.

  11. #11
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Run Time Error 1004 on code

    Marcol, thanks for taking the time to look through my post. I will make a new workbook and post this up shortly and will try and explain a step to step guide as to what i am looking to do.

  12. #12
    Forum Contributor
    Join Date
    06-16-2008
    Posts
    287

    Re: Run Time Error 1004 on code

    Hi, what i am looking to do is, through the use of a pivot table, build a structure and sheets for everyone that belongs to a certain individual.

    For example, i have created a sample workbook that shows what my final workbook should look like once macro has been ran.

    Step1: PopUp Appears to enter the Senior Manager i.e. L4 A

    Step2: Once entered, value appears in cell B2 and then need a macro to find this value in StaffList Sheet (A24:D42) and also everyone that belongs to L4 A.

    Step3: This then creates a L4 A Sheet and then from the ColumntoPaste Sheet copies the template from A1:P61 (this will have vlookup formulas later on) and then pastes this into cell I2.

    Step4: This then now looks for the first value (L5 AA) that belongs to L4 A in Col B (B24:B42) and then from the ColumntoPaste Sheet copies the template from A1:P61 and then pastes this into next available cell in row 2 (Y2).

    At the same time this needs to create a separate Sheet for L5 AA and so forth until the last value in Col D24:D42 that belongs to L4 A)

    I have attached a sample workbook of what the final product should look like. I can explain the steps further but i think the above steps should give you an idea of what i am trying to do.

    Hope this helps. Thanks once again.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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