Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2007

Tip: Looking for answers? Try searching our database.

Borders

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Khalil Handal - 27 Jun 2007 18:39 GMT
Hello to all,
I have a range of cells C34:N35
I need VBA code in order to have borders for this range or clearing the
borders depending on the checkbox if it is cliked or not.
ie. The code will be part of CheckBox2 button with condition to show the
border or hide them.The sheet is protected.
Don Guillett - 27 Jun 2007 19:58 GMT
Homework?

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

> Hello to all,
> I have a range of cells C34:N35
> I need VBA code in order to have borders for this range or clearing the
> borders depending on the checkbox if it is cliked or not.
> ie. The code will be part of CheckBox2 button with condition to show the
> border or hide them.The sheet is protected.
Khalil Handal - 28 Jun 2007 12:06 GMT
NOT homework!
I was able to show / hide the numbers inside the range according to the
check box by changing the color to white and then black again. It didn't
look nice to have borders for empty cells! so the idea came to not see the
borders.
I recorded the macro and it has (i think) seven line which looks too long.

Thanks to both of you.

> Homework?
>
[quoted text clipped - 4 lines]
>> ie. The code will be part of CheckBox2 button with condition to show the
>> border or hide them.The sheet is protected.
Don Guillett - 28 Jun 2007 13:10 GMT
You can adapt this to make the borders

Sub bordersaround()
Worksheets("Sheet1").Range("A1:D4").BorderAround _
       ColorIndex:=3, Weight:=xlThick
'Selection.bordersaround
End Sub

or this to erase them

Sub noborders()
Worksheets("Sheet1").Range("A1:D4") _
.Borders.LineStyle = xlNone
End Sub

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

> NOT homework!
> I was able to show / hide the numbers inside the range according to the
[quoted text clipped - 13 lines]
>>> ie. The code will be part of CheckBox2 button with condition to show the
>>> border or hide them.The sheet is protected.
Khalil Handal - 28 Jun 2007 14:43 GMT
Thanks!
I was always interestred in spliting the line in VB code which is seen as _
.
What key combination does this?????

> You can adapt this to make the borders
>
[quoted text clipped - 29 lines]
>>>> ie. The code will be part of CheckBox2 button with condition to show
>>>> the border or hide them.The sheet is protected.
Gord Dibben - 28 Jun 2007 15:16 GMT
That is the underscore character.   SHIFT + - (hyphen)

Make sure you have a <space> between last character and the underscore _

Gord Dibben  MS Excel MVP

>Thanks!
>I was always interestred in spliting the line in VB code which is seen as _
[quoted text clipped - 34 lines]
>>>>> ie. The code will be part of CheckBox2 button with condition to show
>>>>> the border or hide them.The sheet is protected.
Khalil Handal - 28 Jun 2007 16:11 GMT
Thanks

> That is the underscore character.   SHIFT + - (hyphen)
>
[quoted text clipped - 43 lines]
>>>>>> ie. The code will be part of CheckBox2 button with condition to show
>>>>>> the border or hide them.The sheet is protected.
ShaneDevenshire - 27 Jun 2007 20:16 GMT
Hi,

Record the code to turn on and off the borders and put it inside the
Checkbox_Click procedure.

Signature

Cheers,
Shane Devenshire

> Hello to all,
> I have a range of cells C34:N35
> I need VBA code in order to have borders for this range or clearing the
> borders depending on the checkbox if it is cliked or not.
> ie. The code will be part of CheckBox2 button with condition to show the
> border or hide them.The sheet is protected.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.