+ Reply to Thread
Results 1 to 17 of 17

VBA Thick borders around select dates

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    VBA Thick borders around select dates

    Afternoon everyone,

    Wondering if anyone could help me with a calendar I've got. I've been able to do the border via conditional formatting - however you can only make thin borders (Which you can hardly see as this will need to be printed)

    I was wondering if there was a way in vba to look at a range of dates and place a thick border around them?

    Any input would be great, thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA Thick borders around select dates

    Hello jsneak,

    Why don't you just change the Color of the Cell Border?

    That would be the easiest and fastest solution.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: VBA Thick borders around select dates

    I might have to do that...

    I've tried loads of different things, i've got some VBA that will put the border around a cell, i just cant get the VBA to select the dates from the formulas in the months.... Would there be a way of using INT in VBA?? A bit like the conditional formatting i've got on that page?

    Thanks for the reply though

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA Thick borders around select dates

    Thank you for your response jsneak,

    I am afraid that it won't work since Conditional Formatting will override the VBA attempt.

    Regards.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: VBA Thick borders around select dates

    If you are happy to turn each month into a named range, you could use something like (I used Jan, Feb etc as named ranges)
    Please Login or Register  to view this content.
    You'll need to remove the CF.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA Thick borders around select dates

    Hi Fluff13,

    I thought of the same which you suggest, but then again, the OP will have to amend his Conditional Formatting to apply to Cell Interior Colors, and only delete the Conditional Formatting for Borders.
    Do you agree?

    Kind regards.

  7. #7
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: VBA Thick borders around select dates

    That's brilliant, thank you. I'll have a play around with it now.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: VBA Thick borders around select dates

    Quote Originally Posted by Winon View Post
    Hi Fluff13,

    I thought of the same which you suggest, but then again, the OP will have to amend his Conditional Formatting to apply to Cell Interior Colors, and only delete the Conditional Formatting for Borders.
    Do you agree?
    Must admit I hadn't noticed all the CF for cell fill as the formulae are broken. But if the OP needs the fill that can be done in code & delete all the CF, or as you mention just delete the CF for borders.
    As most of the formulae are broken it's difficult to know what they are for.

  9. #9
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: VBA Thick borders around select dates

    Yeah that's because I removed the other dates lol ...there was a big list of them that went across.
    I just wanted to see if there was a VBA way of doing it 👍😬

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA Thick borders around select dates

    @ Fluff13,

    Good work indeed!

    Thanks for the feedback.

    Regards.

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA Thick borders around select dates

    Hello jsneak,

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    You may want to award some Rep Points where you feel it is deserved, by clicking on the Star(*) bottom left of the Post/s you found useful.

    Thanks.

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: VBA Thick borders around select dates

    Quote Originally Posted by Winon View Post
    @ Fluff13,

    Good work indeed!

    Thanks for the feedback.

    Regards.
    Thanks for that & the rep

  13. #13
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: VBA Thick borders around select dates

    Quote Originally Posted by Fluff13 View Post
    If you are happy to turn each month into a named range, you could use something like (I used Jan, Feb etc as named ranges)
    Please Login or Register  to view this content.
    You'll need to remove the CF.
    Thanks for the input everyone.

    Sorry is the "mmm" where you define the month? I keep getting Method 'Range' of object_ 'Global' failed..

  14. #14
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA Thick borders around select dates

    Hello jsneak,

    Try changing the "mmm" to "mm".

    Regards.

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: VBA Thick borders around select dates

    Try it like this
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: VBA Thick borders around select dates

    Perfect mate, thanks for all your help

  17. #17
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: VBA Thick borders around select dates

    Glad we could help & thanks for the feedback

+ 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. vba to strike columns with thick outer borders
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2018, 02:23 PM
  2. [SOLVED] Auto change borders to thick borders
    By Pierce Quality in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-22-2013, 11:17 PM
  3. [SOLVED] Creating thick borders around rows
    By oneillp1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2013, 11:45 AM
  4. Excel vba puzzle -- Thick or double cell borders significantly slow vba code
    By skappy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-01-2012, 06:55 PM
  5. Format Borders - Thick Outside - Thin Inside
    By mccrimmon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2011, 10:51 AM
  6. Thick Borders
    By OfficeBitty in forum Excel General
    Replies: 10
    Last Post: 11-28-2006, 11:16 AM
  7. [SOLVED] Conditional Formatting - Thick Borders?
    By fedude in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2006, 05:35 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