#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Border help

After finding a specific cell how can I set borders for the entire row? For
instance:

Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).EntireRow.Activate

I try to set up the borders for that entire row but it is not working. Help?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Border help

Hi erikkeith

Record a macro when you do this en then look at the code

--
Regards Ron de Bruin
http://www.rondebruin.nl


"erikkeith via OfficeKB.com" <u13156@uwe wrote in message news:5fe2a77d1e9b6@uwe...
After finding a specific cell how can I set borders for the entire row? For
instance:

Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).EntireRow.Activate

I try to set up the borders for that entire row but it is not working. Help?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Border help

You must not have understood my question. I want to be able to set up the
borders for cells A:O on the row that the "find" found what I was looking for.
.....that being "Totals"

Ron de Bruin wrote:
Hi erikkeith

Record a macro when you do this en then look at the code

After finding a specific cell how can I set borders for the entire row? For
instance:

[quoted text clipped - 4 lines]

I try to set up the borders for that entire row but it is not working. Help?


--
Message posted via http://www.officekb.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Border help

You select the row with your code so if you record a macro you can add this to your code

Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).EntireRow.Activate

Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
Selection.Borders(xlEdgeRight).LineStyle = xlContinuous


--
Regards Ron de Bruin
http://www.rondebruin.nl


"erikkeith via OfficeKB.com" <u13156@uwe wrote in message news:5fe3c2428134c@uwe...
You must not have understood my question. I want to be able to set up the
borders for cells A:O on the row that the "find" found what I was looking for.
....that being "Totals"

Ron de Bruin wrote:
Hi erikkeith

Record a macro when you do this en then look at the code

After finding a specific cell how can I set borders for the entire row? For
instance:

[quoted text clipped - 4 lines]

I try to set up the borders for that entire row but it is not working. Help?


--
Message posted via http://www.officekb.com



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Border help

Yes, but how can I do it for just cells A through O? I find "Totals" on row
100 and then want cells adjust the borders for cells A:O for just that row. ?
????

Ron de Bruin wrote:
You select the row with your code so if you record a macro you can add this to your code

Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).EntireRow.Activate

Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
Selection.Borders(xlEdgeRight).LineStyle = xlContinuous

You must not have understood my question. I want to be able to set up the
borders for cells A:O on the row that the "find" found what I was looking for.

[quoted text clipped - 9 lines]

I try to set up the borders for that entire row but it is not working. Help?


--
Message posted via http://www.officekb.com


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Border help

Sub test()
Dim rng As Range

Set rng = Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)

If Not rng Is Nothing Then
With rng.Resize(1, 15)
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
End With
Else
MsgBox "Nothing found"
End If

End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"erikkeith via OfficeKB.com" <u13156@uwe wrote in message news:5fe44c41489a1@uwe...
Yes, but how can I do it for just cells A through O? I find "Totals" on row
100 and then want cells adjust the borders for cells A:O for just that row. ?
????

Ron de Bruin wrote:
You select the row with your code so if you record a macro you can add this to your code

Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).EntireRow.Activate

Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
Selection.Borders(xlEdgeRight).LineStyle = xlContinuous

You must not have understood my question. I want to be able to set up the
borders for cells A:O on the row that the "find" found what I was looking for.

[quoted text clipped - 9 lines]

I try to set up the borders for that entire row but it is not working. Help?


--
Message posted via http://www.officekb.com



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Border help

You must not have understood my question. I want to be able to set up the
borders for cells A:O on the row that the "find" found what I was looking for.
.....that being "Totals"

Ron de Bruin wrote:
Hi erikkeith

Record a macro when you do this en then look at the code

After finding a specific cell how can I set borders for the entire row? For
instance:

[quoted text clipped - 4 lines]

I try to set up the borders for that entire row but it is not working. Help?


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1
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
border Sarah Excel Worksheet Functions 2 December 2nd 07 12:55 AM
Border MADDY Excel Discussion (Misc queries) 5 November 30th 07 04:55 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
Border Derrick Robinson Excel Worksheet Functions 2 May 9th 05 03:00 AM


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

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

About Us

"It's about Microsoft Excel"