.BorderAround

dinotom

Active Member
Joined
Aug 2, 2009
Messages
357
with rngCDTemp being set to a range (a valid range )

why does this bolded line produce an error (trying to put a thin line border around the whole range)

Code:
 With rngCDTemp.Select
        [B].BorderAround.Weight = xlThin[/B]
        ActiveWorkbook.Names.Add Name:=AcctName & "ChtDataTable", _
        RefersTo:=rngCDTemp
     End With
 
Thomas

I'm getting increasingly confused, and it's not just an age thing.

The code I posted worked.

If similar code doesn't work for you then you need to post that code, it could be a problem with the range.

But that's kind of hard to determine without seeing how it has been created/referred to in earlier code.

I also don't understand what you are saying about using With.

Sure you could do something along those lines but you would have to actually reference the object the With is associated to.

And you aren't doing that in the code you've posted.:)
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,214,897
Messages
6,122,151
Members
449,068
Latest member
shiz11713

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top