Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
border on last cell of page effects border on beginning cell of ne | Excel Discussion (Misc queries) | |||
Change cell selection border color in excel to stand out more? | Excel Worksheet Functions | |||
Cell Selection, Border Changing | Excel Programming | |||
Changing the border of one cell s/n change the border of adjacent | Excel Discussion (Misc queries) | |||
Animated selection border | Excel Programming |