+ Reply to Thread
Results 1 to 9 of 9

Find element of my macro is not working

  1. #1
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    Find element of my macro is not working

    Hello,

    The following macro is not working as it states "Object variable or With block variable not set

    The macro is below. It is showing the error on the
    Please Login or Register  to view this content.
    Here is the macro in whole:
    Please Login or Register  to view this content.
    Thank You

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Find element of my macro is not working

    You need to declare an object variable

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Find element of my macro is not working

    This works thank you

    However i am now getting "Run-time error '1004' on the following line of the macro

    Please Login or Register  to view this content.
    here is the code in whole

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Find element of my macro is not working

    You will get many errors as the code you have is a recorded macro.
    You have used the property "Selection" lots of time. This is prone to errors.
    Please attach the sample to see how to change the code.

  5. #5
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Find element of my macro is not working

    apologies for the delayed response

    Attached is the sample workbook

    SAMPLE.xls

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Find element of my macro is not working

    Please explain what do you want to do once the code finds delivery dat in sheet All Parts?

  7. #7
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Find element of my macro is not working

    I want it to cut the delivery date row and place it in column A, moving the material column to the right. This will allow the formulas in the table on the charts sheet to populate the total number of parts in each year. The unsourced list may change each month meaning delivery date will not always be in the same column which is why the macro has to find the delivery date instead of cutting a particular column.

    I want the table on the Charts sheet to automatically update which creates the chart below it. The last piece of data will move to the above row which will allow the chart to show a trend in the improvements made over tha past 8 weeks.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Find element of my macro is not working

    I have not looked at the rest of the code, but the first top bit of the code works.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: Find element of my macro is not working

    This works perfectly now, thank you!

+ 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. LOOKUP : Find Last element Interesting formula
    By OldSwimmer1500m in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-05-2013, 03:41 PM
  2. How to find the element which contains part of a string in an array
    By lgjmac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-02-2013, 04:45 PM
  3. Find the number of element in the column
    By simi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-28-2012, 10:42 PM
  4. [SOLVED] how to find the row number of an element in a range
    By webfeet2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2012, 12:33 AM
  5. find the index number for an array element
    By Dick Minter in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-20-2006, 07:01 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