Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to border row from start column to end column


I want to create a macro where if a value is entered in column "B", then
I want the row (from Column A to G) that the value was entered in to be
bordered with a thin outline and thin inside lines.

BUT, if a value in column "B" is deleted, then I want the border
removed in that row from column "A" to "G".

I would use conditional formatting but I've used them up for other
criterias.
This will also perform upon every change in the worksheet...so please
don't forget:

Private Sub WorkSheet_Change(ByVal Target As Excel.Range)


I'm still a novice at VBA, but I'm trying to make a macro right now
that does this.


Thanks in advance.


--
malik641


------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=389185

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Macro to border row from start column to end column

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 Then
If Target.Value = Empty Then
Range(Target.Offset(0, -1), Target.Offset(0,
5)).Borders.LineStyle = xlNone
Else
Range(Target.Offset(0, -1), Target.Offset(0, 5)).Borders.Weight
= xlThin
End If
End If
End Sub
--
HTH...

Jim Thomlinson


"malik641" wrote:


I want to create a macro where if a value is entered in column "B", then
I want the row (from Column A to G) that the value was entered in to be
bordered with a thin outline and thin inside lines.

BUT, if a value in column "B" is deleted, then I want the border
removed in that row from column "A" to "G".

I would use conditional formatting but I've used them up for other
criterias.
This will also perform upon every change in the worksheet...so please
don't forget:

Private Sub WorkSheet_Change(ByVal Target As Excel.Range)


I'm still a novice at VBA, but I'm trying to make a macro right now
that does this.


Thanks in advance.


--
malik641


------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=389185


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to border row from start column to end column


Hey Jim, thanks a lot! Macro works flawlessly!!!


--
malik641


------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=389185

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to border row from start column to end column


Now I have another question...
The macro won't work for one of my workbooks. The workbook collects
data from another workbook (i.e. =[Workbook1.xls]Sheet1! type) and I
ALSO want this workbook to have the macro work the same way...but it
won't.

How do I make this macro work for this workbook?


--
malik641


------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=389185

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to border row from start column to end column


anyone????

--
malik64

-----------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...fo&userid=2419
View this thread: http://www.excelforum.com/showthread.php?threadid=38918

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
Sum values in a column depending on start time in another column Morgan New Users to Excel 5 October 26th 09 01:02 AM
COLUMN BORDER ISSUE William Excel Discussion (Misc queries) 2 April 1st 09 07:51 PM
how do i keep a total down a column , ie. say start with julie Excel Worksheet Functions 2 July 19th 07 03:02 AM
Determine start column/ end column of Merged Cell jC! Excel Programming 3 July 8th 04 12:05 PM
Red bullets in left border column Fred Smith Excel Programming 1 February 13th 04 02:07 AM


All times are GMT +1. The time now is 06:43 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"