Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default With statement parameters

I am getting an error message of, "wrong number of arguments or invalid
property assignment" and .Borders is highlighted. see between *@. I was
hoping to avoid having a separate with statement for every xlEdgeLeft,
xlEdgeTop etc. Can someone let me know if it can be done this way and what
I need to do to make it work? thanx

With Range("A1:AQ1")
.NumberFormat = "General"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
With *@.Borders*@(xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight,
xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Font
.Name = "Arial"
.Size = 8
.Bold = False
.ColorIndex = xlAutomatic
End With
With .Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default With statement parameters


v = Array(xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight, xlInsideVertical)
for i = lbound(v) to ubound(v)
With .Borders(v(i))
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next
With .Font
.Name = "Arial"
.Size = 8
.Bold = False
.ColorIndex = xlAutomatic
End With
With .Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
End With


--
Regards,
Tom Ogilvy

"Arnold Klapheck" wrote:

I am getting an error message of, "wrong number of arguments or invalid
property assignment" and .Borders is highlighted. see between *@. I was
hoping to avoid having a separate with statement for every xlEdgeLeft,
xlEdgeTop etc. Can someone let me know if it can be done this way and what
I need to do to make it work? thanx

With Range("A1:AQ1")
.NumberFormat = "General"
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
With *@.Borders*@(xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight,
xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With .Font
.Name = "Arial"
.Size = 8
.Bold = False
.ColorIndex = xlAutomatic
End With
With .Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
End With

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default With statement parameters

Thanks, that worked, I just needed to:
Dim v As Variant
Dim i As Integer

I have option explicit on. if these are the wrong type let me know otherwise
response is not necessary, again thanx
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
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
SQL & Like Parameters George Applegate[_2_] Excel Discussion (Misc queries) 2 November 2nd 07 06:11 PM
IF Statement with 3 parameters Teri Excel Worksheet Functions 4 January 22nd 07 08:07 PM
too few parameters lou sanderson Excel Discussion (Misc queries) 1 December 14th 05 07:53 PM
IF Statement W/3 Parameters ? Kris-GMA Excel Worksheet Functions 1 October 7th 05 02:40 PM


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