Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Border the selection cell

Hi All,

Is there any vba code for bordering the entire row and entire column of
the cell selected and remove border when the cell is changed.

ie.,
1 - When i select a cell on the worksheet the entire row and entire
column should be highlited by a border.
2 - When the selection is changed the border of the previous cells row
and column should and activecells row and column should be bordered.

If any problem in understanding please revert back.


Regards
A

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default Border the selection cell

You could always record a macro of both operations. Then Alt-F11 and look at
what code was recorded.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Thyagaraj" wrote:
| Hi All,
|
| Is there any vba code for bordering the entire row and entire column of
| the cell selected and remove border when the cell is changed.
|
| ie.,
| 1 - When i select a cell on the worksheet the entire row and entire
| column should be highlited by a border.
| 2 - When the selection is changed the border of the previous cells row
| and column should and activecells row and column should be bordered.
|
| If any problem in understanding please revert back.
|
|
| Regards
| A
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Border the selection cell


Dave Patrick wrote:
You could always record a macro of both operations. Then Alt-F11 and look at
what code was recorded.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Thyagaraj" wrote:
| Hi All,
|
| Is there any vba code for bordering the entire row and entire column of
| the cell selected and remove border when the cell is changed.
|
| ie.,
| 1 - When i select a cell on the worksheet the entire row and entire
| column should be highlited by a border.
| 2 - When the selection is changed the border of the previous cells row
| and column should and activecells row and column should be bordered.
|
| If any problem in understanding please revert back.
|
|
| Regards
| A
|Dear Patrick,


I know the code to get border and remove the border but this should
happen when ever the cell is changed how is this possible........?

Any suggesions please


Regards
A

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default Border the selection cell

Add your code to something like this.

Dim OldRange As Range

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Set OldRange = Selection
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
With OldRange
.Interior.ColorIndex = xlNone
End With
With Target
.Interior.ColorIndex = 46
.Interior.Pattern = xlSolid
End With
Set OldRange = Target
End Sub

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Thyagaraj" wrote:
| I know the code to get border and remove the border but this should
| happen when ever the cell is changed how is this possible........?
|
| Any suggesions please
|
|
| Regards
| A
|


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Border the selection cell


Dave Patrick wrote:
Add your code to something like this.

Dim OldRange As Range

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Set OldRange = Selection
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
With OldRange
.Interior.ColorIndex = xlNone
End With
With Target
.Interior.ColorIndex = 46
.Interior.Pattern = xlSolid
End With
Set OldRange = Target
End Sub

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Thyagaraj" wrote:
| I know the code to get border and remove the border but this should
| happen when ever the cell is changed how is this possible........?
|
| Any suggesions please
|
|
| Regards
| A
|

Dear Dave Patrick ,

Thanks


Reg
A



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Border the selection cell


Dave Patrick wrote:
Add your code to something like this.

Dim OldRange As Range

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Set OldRange = Selection
End Sub

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Range)
With OldRange
.Interior.ColorIndex = xlNone
End With
With Target
.Interior.ColorIndex = 46
.Interior.Pattern = xlSolid
End With
Set OldRange = Target
End Sub

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Thyagaraj" wrote:
| I know the code to get border and remove the border but this should
| happen when ever the cell is changed how is this possible........?
|
| Any suggesions please
|
|
| Regards
| A
|

Dear Dave Patrick ,

Thanks


Reg
A

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default Border the selection cell

You're welcome.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Thyagaraj" wrote:
| Dear Dave Patrick ,
|
| Thanks
|
|
| Reg
| A
|


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
border on last cell of page effects border on beginning cell of ne GaryE Excel Discussion (Misc queries) 0 March 23rd 09 05:47 AM
Change cell selection border color in excel to stand out more? Jeanne Excel Worksheet Functions 3 April 11th 08 09:22 PM
Cell Selection, Border Changing Phil H[_2_] Excel Programming 4 May 3rd 06 04:07 AM
Changing the border of one cell s/n change the border of adjacent gjanssenmn Excel Discussion (Misc queries) 2 October 5th 05 08:35 PM
Animated selection border Luke Excel Programming 1 September 5th 05 04:23 PM


All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"