+ Reply to Thread
Results 1 to 10 of 10

Borders.LineStyle = xlContinuous

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    Auzzie
    MS-Off Ver
    Excel 2010
    Posts
    49

    Borders.LineStyle = xlContinuous

    Hi Team

    I have problem with this formula. It works in the 2013 no problems but when trying to run the macro on excel 2007 its a no go. Is there something else I can use to take its place? Sorry I am pretty basic in my understand but I have been able to find this is the problem

    This is the full line
    Range("A16").Resize(Range("A65536").End(xlUp).Row, Range("IV16").End(xlToLeft).Column).Borders.LineStyle = xlContinuous

    Thanks in advance

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Borders.LineStyle = xlContinuous

    Hi top_dog,

    Try changing your
    "A65536" to Cells(Rows.Count , "A")
    and your
    "IV16" to Cells(16, Columns.Count)

    and see if that then works.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-25-2014
    Location
    Auzzie
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Borders.LineStyle = xlContinuous

    I tried it but it didnt work. I keep getting the follow error: method range of object_global failed

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Borders.LineStyle = xlContinuous

    Are you sure your data has something in column A below A16 and stuff to the right of A16?

  5. #5
    Registered User
    Join Date
    02-25-2014
    Location
    Auzzie
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Borders.LineStyle = xlContinuous

    Yep just checked and the data starts under it and has information to the right

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Borders.LineStyle = xlContinuous

    Ok top_dog,

    Use this code instead of the line you have above.

    Range("A16", Cells(Cells(Rows.Count, "A").End(xlUp).Row, Cells(16, Columns.Count).End(xlToLeft).Column)).Borders.LineStyle = xlContinuous

    See if this works..

  7. #7
    Registered User
    Join Date
    02-25-2014
    Location
    Auzzie
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Borders.LineStyle = xlContinuous

    Hey MarvinP I tried it didnt work unfortunately. I think its excel2007 doesn't handle .Borders.LineStyle = xlContinuous?

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Borders.LineStyle = xlContinuous

    Do these steps to see what happens...

    Record a macro using your 2007 Excel. Simply select some cells and make the line format like you want. Read the code and see how it does it. Then use this approach.

    Range("A16", Cells(Cells(Rows.Count, "A").End(xlUp).Row, Cells(16, Columns.Count).End(xlToLeft).Column)).Select
    Selection.(put in here whatever 2007 Excel recorded in the macro).

    This should then work for you.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: Borders.LineStyle = xlContinuous

    MarvinP's code works for me in 2007.
    so does this, which is the same thing.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    02-25-2014
    Location
    Auzzie
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Borders.LineStyle = xlContinuous

    That's weird but Jolivanes your way worked! Thanks so much for both of your help.

+ 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. What is linestyle?
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2015, 06:41 PM
  2. [SOLVED] 1004 (Unable to set LineStyle prperty of the Border class)
    By TimlmiT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-10-2014, 10:56 AM
  3. VBA Excel Borders linestyle - works first time - not second time
    By RxMiller in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-11-2014, 12:51 PM
  4. [SOLVED] Conditional Formatting Macro .LineStyle = xlContinuous error
    By Smeddlesboy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-26-2012, 09:53 AM
  5. xlEdgeBottom border linestyle doesn't work, but xlEdgeTop does?
    By Shane O in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-08-2011, 10:39 AM
  6. .LineStyle = xlContinuous in excel 2000 shows error
    By coolhit in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2009, 06:22 AM
  7. How do I get VBA to copy the MajorGridlines.Border.LineStyle into a variable
    By revector in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2008, 02:33 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