+ Reply to Thread
Results 1 to 20 of 20

not copy guides into the Array

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    not copy guides into the Array

    Hi.
    Anyone, why is it generating error in the code below?

    I want to copy many guides, but I can not copy the tabs that are within
    Please Login or Register  to view this content.
    time error '13 run '
    incompatible types
    Please Login or Register  to view this content.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

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

    Re: not copy guides into the Array

    Replace
    ws1 As Worksheet,

    by
    ws1

    Remove the worksheet, just use ws1

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: not copy guides into the Array

    Hi.

    Maybe i don't understand you.
    I change this line
    Please Login or Register  to view this content.
    Display error
    time error '438 ':
    The object does not support this property or method
    yellow line
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: not copy guides into the Array

    Please Login or Register  to view this content.
    Untested.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

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

    Re: not copy guides into the Array

    The error on that line is because you have assigned an array to an object(worksheet), so if you declare the sheet as variant, the line will not error.
    Sorry! I did not check the rest of the code.

  6. #6
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: not copy guides into the Array

    Hi.

    Error '1004 '

    The cell or chart that you are using is protected and therefore read-only
    Strange, I haven't protected tab


    how the file is over 10MB, I posted on
    http://www.sendspace.com/file/k1vnb8
    Last edited by marreco; 12-17-2013 at 03:28 PM.

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

    Re: not copy guides into the Array

    In which line of the code do you get the error?

  8. #8
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: not copy guides into the Array

    Look
    Error
    Error '1004 '

    The cell or chart that you are using is protected and therefore read-only
    Please Login or Register  to view this content.
    See my file
    http://www.sendspace.com/file/k1vnb8

  9. #9
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: not copy guides into the Array

    Looks like you need to unprotect the sheet first.

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

    Re: not copy guides into the Array

    Amended code if the protect line works.

    My code copies the sheets range in the array in to sheet1.

    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: not copy guides into the Array

    Hi AB33 , sorry, your code copy only one row.

    Why my code before, made ​​the copies of all the guides smoothly (with the blocked realação guides), I'm having problems now?

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

    Re: not copy guides into the Array

    These are your lines

    Please Login or Register  to view this content.
    It should copy range B11: K and last row in each sheet in the array.
    Do you have data in column B which go down to the bottom of it?

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

    Re: not copy guides into the Array

    Try,

    Please Login or Register  to view this content.

  14. #14
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: not copy guides into the Array

    Hi.
    I need to know one thing, the line below, would be copied guides?
    Please Login or Register  to view this content.
    as I have many guides, I preferred Array for the tabs that do NOT want to copy


    if I try by all guides, generates error 9
    Please Login or Register  to view this content.

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

    Re: not copy guides into the Array

    If the error is "Out of script"
    I was unable to access the attached as I do not have the software to download it. Could you please attach it?

    I suspect the error is due to one or more sheet names, which are included in the array do not exist on sheet collection. In other words, you have include some names in the array with "", but these names are not on the active book you are working on.

  16. #16
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: not copy guides into the Array

    Hi.

    look my file..........
    Attached Files Attached Files

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

    Re: not copy guides into the Array

    For the first part of the code, consider using this code while I will look at your code.

    Please Login or Register  to view this content.

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

    Re: not copy guides into the Array

    I have now found the error on the array. As I said some of the sheet names have typos, 3, not 03, 4, not 04. Some of them do not exist, like 07.

    Please check the spelling of each sheet should match to the name you put in to the array.
    Please Login or Register  to view this content.

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

    Re: not copy guides into the Array

    If you get an error "Out of script", It usually means the sheet does not exist in the sheet collection. This could be due to the sheet does not exist, or the spelling on the sheet does not match with the code sheet name. In other words, the sheet does not exist as VBA could not tell if there is a typo.

  20. #20
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: not copy guides into the Array

    Hi.

    Awesome, very good!
    thank you very much!

+ 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. [SOLVED] Copy and paste in two other guides
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-28-2013, 02:10 PM
  2. [SOLVED] hide the duplicate in in different guides
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-28-2013, 11:00 AM
  3. Copy data to several guides per day with discretion
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2012, 07:35 AM
  4. HELP: Row Selection and VBA guides
    By Pedros in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2006, 03:03 AM
  5. How do I use line guides
    By Audrey in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-20-2006, 09:15 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